Sfoglia il codice sorgente

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 anni fa
parent
commit
867c7aef59
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1
    1
      src/net/ipv4.c

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

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

Loading…
Annulla
Salva