ipv4: fix address selection in fib_compute_spec_dst
authorJulian Anastasov <ja@ssi.bg>
Wed, 18 Jul 2012 21:35:03 +0000 (21:35 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 19 Jul 2012 15:30:49 +0000 (08:30 -0700)
ip_options_compile can be called for forwarded packets,
make sure the specific-destionation address is a local one as
specified in RFC 1812, 4.2.2.2 Addresses in Options

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/fib_frontend.c

index 7a31194ec63344f6c0abec0fec41d807dc34fdfb..b83203658ee36247bff46a2ecb68f9795d7651c5 100644 (file)
@@ -206,7 +206,8 @@ __be32 fib_compute_spec_dst(struct sk_buff *skb)
        int scope;
 
        rt = skb_rtable(skb);
-       if (!(rt->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST)))
+       if ((rt->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST | RTCF_LOCAL)) ==
+           RTCF_LOCAL)
                return ip_hdr(skb)->daddr;
 
        in_dev = __in_dev_get_rcu(dev);