diff options
| author | Michael Brown | 2006-08-09 13:52:53 +0200 |
|---|---|---|
| committer | Michael Brown | 2006-08-09 13:52:53 +0200 |
| commit | 867c7aef5935be3b78db7765cb5cd14d3e42b189 (patch) | |
| tree | 7337afc91524ee4f20a2eee4c9427acb21cdbbf1 /src | |
| parent | Remove _PROTOCOL macros for gcc 3.2 compatibility (diff) | |
| download | ipxe-867c7aef5935be3b78db7765cb5cd14d3e42b189.tar.gz ipxe-867c7aef5935be3b78db7765cb5cd14d3e42b189.tar.xz ipxe-867c7aef5935be3b78db7765cb5cd14d3e42b189.zip | |
iphdr->hlen includes the IP header, so truncate packet *before*
stripping the header. Also fix an htons/ntohs confusion.
Diffstat (limited to 'src')
| -rw-r--r-- | src/net/ipv4.c | 2 |
1 files changed, 1 insertions, 1 deletions
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 ); |
