From 8d74559f72f27c89d69123517e0c77de10b3925c Mon Sep 17 00:00:00 2001 From: goldsimon Date: Tue, 7 Jun 2011 19:10:10 +0000 Subject: [PATCH] Moved common call to pbuf_header outside the switch() --- src/core/ipv4/ip.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/ipv4/ip.c b/src/core/ipv4/ip.c index 6f248716..d40e0741 100644 --- a/src/core/ipv4/ip.c +++ b/src/core/ipv4/ip.c @@ -488,6 +488,7 @@ ip_input(struct pbuf *p, struct netif *inp) if (raw_input(p, inp) == 0) #endif /* LWIP_RAW */ { + pbuf_header(p, -iphdr_hlen); /* Move to payload, no check necessary. */ switch (IPH_PROTO(iphdr)) { #if LWIP_UDP @@ -521,6 +522,7 @@ ip_input(struct pbuf *p, struct netif *inp) /* send ICMP destination protocol unreachable unless is was a broadcast */ if (!ip_addr_isbroadcast(¤t_iphdr_dest, inp) && !ip_addr_ismulticast(¤t_iphdr_dest)) { + pbuf_header(p, iphdr_hlen); /* Move to ip header, no check necessary. */ p->payload = iphdr; icmp_dest_unreach(p, ICMP_DUR_PROTO); }