1
0
Fork 0

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 <ja@ssi.bg>
Signed-off-by: David S. Miller <davem@davemloft.net>
hifive-unleashed-5.1
Julian Anastasov 2012-07-18 21:35:03 +00:00 committed by David S. Miller
parent 6255e5ead0
commit 0cc535a299
1 changed files with 2 additions and 1 deletions

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