]> rtime.felk.cvut.cz Git - pes-rpp/rpp-lwip.git/commitdiff
Better fix for bug #35927 (missing refragmentaion in ip_forward) when IP_FRAG is...
authorgoldsimon <goldsimon@gmx.de>
Sun, 25 Mar 2012 13:12:42 +0000 (15:12 +0200)
committergoldsimon <goldsimon@gmx.de>
Sun, 25 Mar 2012 13:12:42 +0000 (15:12 +0200)
src/core/ipv4/ip4.c

index e6be1203cf5933c323ffed3b628688a613714ced..642d32a68e401894bfda39872255dd9cdc15aaf5 100644 (file)
@@ -255,17 +255,17 @@ ip_forward(struct pbuf *p, struct ip_hdr *iphdr, struct netif *inp)
   PERF_STOP("ip_forward");
   /* don't fragment if interface has mtu set to 0 [loopif] */
   if (netif->mtu && (p->tot_len > netif->mtu)) {
-#if IP_FRAG
     if ((IPH_OFFSET(iphdr) & PP_NTOHS(IP_DF)) == 0) {
+#if IP_FRAG
       ip_frag(p, netif, ip_current_dest_addr());
+#else /* IP_FRAG */
+      /* @todo: send ICMP Destination Unreacheable code 13 "Communication administratively prohibited"? */
+#endif /* IP_FRAG */
     } else {
       /* send ICMP Destination Unreacheable code 4: "Fragmentation Needed and DF Set" */
       icmp_dest_unreach(p, ICMP_DUR_FRAG);
     }
     return;
-#else /* IP_FRAG */
-    /* @todo: send ICMP Destination Unreacheable code 13 "Communication administratively prohibited"? */
-#endif /* IP_FRAG */
   }
   /* transmit pbuf on chosen interface */
   netif->output(netif, p, ip_current_dest_addr());