Browse Source

iphdr->hlen includes the IP header, so truncate packet *before*

stripping the header.  Also fix an htons/ntohs confusion.
tags/v0.9.3
Michael Brown 18 years ago
parent
commit
867c7aef59
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/net/ipv4.c

+ 1
- 1
src/net/ipv4.c View File

441
 	dest.sin.sin_addr = iphdr->dest;
441
 	dest.sin.sin_addr = iphdr->dest;
442
 
442
 
443
 	/* Strip header */
443
 	/* Strip header */
444
+	pkb_unput ( pkb, pkb_len ( pkb ) - ntohs ( iphdr->len ) );
444
 	pkb_pull ( pkb, sizeof ( *iphdr ) );
445
 	pkb_pull ( pkb, sizeof ( *iphdr ) );
445
-	pkb_unput ( pkb, pkb_len ( pkb ) - htons ( iphdr->len ) );
446
 
446
 
447
 	/* Send it to the transport layer */
447
 	/* Send it to the transport layer */
448
 	return tcpip_rx ( pkb, iphdr->protocol, &src.st, &dest.st );
448
 	return tcpip_rx ( pkb, iphdr->protocol, &src.st, &dest.st );

Loading…
Cancel
Save