Skip to content

Commit 0cc535a

Browse files
Julian Anastasovdavem330
authored andcommitted
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>
1 parent 6255e5e commit 0cc535a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/ipv4/fib_frontend.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ __be32 fib_compute_spec_dst(struct sk_buff *skb)
206206
int scope;
207207

208208
rt = skb_rtable(skb);
209-
if (!(rt->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST)))
209+
if ((rt->rt_flags & (RTCF_BROADCAST | RTCF_MULTICAST | RTCF_LOCAL)) ==
210+
RTCF_LOCAL)
210211
return ip_hdr(skb)->daddr;
211212

212213
in_dev = __in_dev_get_rcu(dev);

0 commit comments

Comments
 (0)