lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] Do not fragment (DF) in a UDP transmission.


From: address@hidden
Subject: Re: [lwip-users] Do not fragment (DF) in a UDP transmission.
Date: Thu, 2 Apr 2020 20:32:20 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0

Am 31.03.2020 um 02:13 schrieb Roger Cover:
> Greetings Simon,
>
> I have implemented this by adding a flag bit for the struct pbuf field 
> "flags". There were two unused bits, so I named one PBUF_FLAG_DF. I then 
> altered ip.c to use this flag to decide whether to set the DF flag in the IP 
> packet header upon transmission. This method only added 2 lines to pbuf.h and 
> added 3 lines and altered one in ip.c.
>
> Here is the diff for pbuf.h (I am using lwIP 1.4.1):
> diff -r 
> C:\Users\RCover\Documents\C_Source\9870\lwIP_1_4_1_lib\src\include\lwip\pbuf.h
>  M:\DRAWINGS\9870-_ECO3389\9870-.zip\lwIP_1_4_1_lib\src\include\lwip\pbuf.h
> 78,79d77
> < /** indicates the IP header for this pbuf should have the DF flag set on 
> transmission */
> < #define PBUF_FLAG_DF                0x40U
>
> Here is the diff for ip.c:
> diff -r 
> C:\Users\RCover\Documents\C_Source\9870\lwIP_1_4_1_lib\src\core\ipv4\ip.c 
> M:\DRAWINGS\9870-_ECO3389\9870-.zip\lwIP_1_4_1_lib\src\core\ipv4\ip.c
> 738,741c738
> <     IPH_OFFSET_SET(iphdr, (p->flags & PBUF_FLAG_DF) ? PP_HTONS(IP_DF) : 0);
> < #if CHECKSUM_GEN_IP_INLINE
> <     chk_sum += iphdr->_offset;
> < #endif /* CHECKSUM_GEN_IP_INLINE */
> ---
>>     IPH_OFFSET_SET(iphdr, 0);
>
> I have tested this, and it works well. It has minimal impact on the lwIP 
> source, so hopefully it will be accepted.

Sorry, but I don't want to implement this in an lwIP specific way. If it
can be done using a standard interface (or more than one), I'm open to
implement it.

Regards,
Simon



reply via email to

[Prev in Thread] Current Thread [Next in Thread]