Skip to content

Commit

Permalink
ipv4: fix address selection in fib_compute_spec_dst
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Julian Anastasov authored and David S. Miller committed Jul 19, 2012
1 parent 6255e5e commit 0cc535a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/ipv4/fib_frontend.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0cc535a

Please sign in to comment.