瀏覽代碼

[IPV4]: skb->dst can't be NULL in ip_options_echo.

ip_options_echo is called on the packet input path after the initial
routing. The dst entry on the packet is cleared only in the several
very specific places and immidiately assigned back (may be new).

Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Denis V. Lunev 18 年之前
父節點
當前提交
da7ef338a2
共有 1 個文件被更改,包括 1 次插入4 次删除
  1. 1 4
      net/ipv4/ip_options.c

+ 1 - 4
net/ipv4/ip_options.c

@@ -107,10 +107,7 @@ int ip_options_echo(struct ip_options * dopt, struct sk_buff * skb)
 	sptr = skb_network_header(skb);
 	sptr = skb_network_header(skb);
 	dptr = dopt->__data;
 	dptr = dopt->__data;
 
 
-	if (skb->dst)
-		daddr = ((struct rtable*)skb->dst)->rt_spec_dst;
-	else
-		daddr = ip_hdr(skb)->daddr;
+	daddr = ((struct rtable*)skb->dst)->rt_spec_dst;
 
 
 	if (sopt->rr) {
 	if (sopt->rr) {
 		optlen  = sptr[sopt->rr+1];
 		optlen  = sptr[sopt->rr+1];