Commit a0d78ebf authored by YOSHIFUJI Hideaki's avatar YOSHIFUJI Hideaki Committed by David S. Miller

[IPV6] ROUTE: Do not route packets to link-local address on other device.

With help from Wei Dong <weid@np.css.fujitsu.com>.
Signed-off-by: default avatarYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 26932566
...@@ -311,12 +311,21 @@ static inline void rt6_probe(struct rt6_info *rt) ...@@ -311,12 +311,21 @@ static inline void rt6_probe(struct rt6_info *rt)
static int inline rt6_check_dev(struct rt6_info *rt, int oif) static int inline rt6_check_dev(struct rt6_info *rt, int oif)
{ {
struct net_device *dev = rt->rt6i_dev; struct net_device *dev = rt->rt6i_dev;
if (!oif || dev->ifindex == oif) int ret = 0;
if (!oif)
return 2; return 2;
if ((dev->flags & IFF_LOOPBACK) && if (dev->flags & IFF_LOOPBACK) {
rt->rt6i_idev && rt->rt6i_idev->dev->ifindex == oif) if (!WARN_ON(rt->rt6i_idev == NULL) &&
return 1; rt->rt6i_idev->dev->ifindex == oif)
ret = 1;
else
return 0; return 0;
}
if (dev->ifindex == oif)
return 2;
return ret;
} }
static int inline rt6_check_neigh(struct rt6_info *rt) static int inline rt6_check_neigh(struct rt6_info *rt)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment