瀏覽代碼

[IPV4]: ip_options_fragment() has no effect on fragmentation

Fix error point to options in ip_options_fragment(). optptr get a
error pointer to the ipv4 header, correct is pointer to ipv4 options.

Signed-off-by: Wei Yongjun <weiyj@soft.fujitsu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Wei Yongjun 19 年之前
父節點
當前提交
63cbd2fda3
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      net/ipv4/ip_options.c

+ 1 - 1
net/ipv4/ip_options.c

@@ -209,7 +209,7 @@ int ip_options_echo(struct ip_options * dopt, struct sk_buff * skb)
 
 
 void ip_options_fragment(struct sk_buff * skb) 
 void ip_options_fragment(struct sk_buff * skb) 
 {
 {
-	unsigned char * optptr = skb->nh.raw;
+	unsigned char * optptr = skb->nh.raw + sizeof(struct iphdr);
 	struct ip_options * opt = &(IPCB(skb)->opt);
 	struct ip_options * opt = &(IPCB(skb)->opt);
 	int  l = opt->optlen;
 	int  l = opt->optlen;
 	int  optlen;
 	int  optlen;