From 0cc535a29916c6a0e6e6af0f3d42c2fe3b0b145d Mon Sep 17 00:00:00 2001 From: Julian Anastasov Date: Wed, 18 Jul 2012 21:35:03 +0000 Subject: [PATCH] ipv4: fix address selection in fib_compute_spec_dst 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 Signed-off-by: David S. Miller --- net/ipv4/fib_frontend.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index 7a31194ec633..b83203658ee3 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c @@ -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); -- 2.30.2