Ver código fonte

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 anos atrás
pai
commit
867c7aef59
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1
    1
      src/net/ipv4.c

+ 1
- 1
src/net/ipv4.c Ver arquivo

@@ -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 );

Carregando…
Cancelar
Salvar