mirror of
https://github.com/xcat2/xNBA.git
synced 2024-12-24 12:11:33 +00:00
iphdr->hlen includes the IP header, so truncate packet *before*
stripping the header. Also fix an htons/ntohs confusion.
This commit is contained in:
parent
ee9ae8130a
commit
867c7aef59
@ -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 );
|
||||
|
Loading…
Reference in New Issue
Block a user