From 996d5fda690f53828e0ba6b2ee1fc35dd923c418 Mon Sep 17 00:00:00 2001 From: fbernon Date: Fri, 30 Mar 2007 13:30:42 +0000 Subject: [PATCH] ip.c: if IP_REASSEMBLY is set to 1, don't set the IP_DF ("Don't fragment") flag in the IP header in IP output packets. --- CHANGELOG | 6 +++++- src/core/ipv4/ip.c | 10 ++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 686c9185..da486008 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -98,6 +98,10 @@ HISTORY ++ Bug fixes: + 2007-03-30 Frédéric Bernon + * ip.c: if IP_REASSEMBLY is set to 1, don't set the IP_DF ("Don't fragment") flag + in the IP header in IP output packets. + 2007-03-30 Frédéric Bernon * api_msg.c: add a "pcb_new" helper function to avoid redundant code, and to add missing pcb allocations checking (in do_bind, and for each raw_new). Fix style. @@ -105,7 +109,7 @@ HISTORY 2007-03-30 Frédéric Bernon * most of files: prefix all debug.h define with "LWIP_" to avoid any conflict with others environment defines (these were too "generic"). - + 2007-03-28 Frédéric Bernon * api.h, api_lib.c, sockets.c: netbuf_ref doesn't check its internal pbuf_alloc call result and can cause a crash. lwip_send now check netbuf_ref result. diff --git a/src/core/ipv4/ip.c b/src/core/ipv4/ip.c index 0d29141e..a8a660da 100644 --- a/src/core/ipv4/ip.c +++ b/src/core/ipv4/ip.c @@ -438,7 +438,11 @@ ip_output_if(struct pbuf *p, struct ip_addr *src, struct ip_addr *dest, IPH_VHLTOS_SET(iphdr, 4, IP_HLEN / 4, tos); IPH_LEN_SET(iphdr, htons(p->tot_len)); +#if IP_REASSEMBLY + IPH_OFFSET_SET(iphdr, 0); +#else IPH_OFFSET_SET(iphdr, htons(IP_DF)); +#endif /* IP_REASSEMBLY */ IPH_ID_SET(iphdr, htons(ip_id)); ++ip_id; @@ -538,9 +542,3 @@ ip_debug_print(struct pbuf *p) LWIP_DEBUGF(IP_DEBUG, ("+-------------------------------+\n")); } #endif /* IP_DEBUG */ - - - - - -