From: Michael Brown Date: Wed, 9 Aug 2006 11:52:53 +0000 (+0000) Subject: iphdr->hlen includes the IP header, so truncate packet *before* X-Git-Tag: v0.9.3~1113 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=867c7aef5935be3b78db7765cb5cd14d3e42b189;p=thirdparty%2Fipxe.git iphdr->hlen includes the IP header, so truncate packet *before* stripping the header. Also fix an htons/ntohs confusion. --- diff --git a/src/net/ipv4.c b/src/net/ipv4.c index 5f10d6843..05a00194e 100644 --- a/src/net/ipv4.c +++ b/src/net/ipv4.c @@ -441,8 +441,8 @@ static int ipv4_rx ( struct pk_buff *pkb, struct net_device *netdev __unused, dest.sin.sin_addr = iphdr->dest; /* Strip header */ + pkb_unput ( pkb, pkb_len ( pkb ) - ntohs ( iphdr->len ) ); pkb_pull ( pkb, sizeof ( *iphdr ) ); - pkb_unput ( pkb, pkb_len ( pkb ) - htons ( iphdr->len ) ); /* Send it to the transport layer */ return tcpip_rx ( pkb, iphdr->protocol, &src.st, &dest.st );