浏览代码

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 19 年前
父节点
当前提交
867c7aef59
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1
    1
      src/net/ipv4.c

+ 1
- 1
src/net/ipv4.c 查看文件

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

正在加载...
取消
保存