Skip to content

Commit

Permalink
[IPV6] ROUTE: Do not route packets to link-local address on other dev…
Browse files Browse the repository at this point in the history
…ice.

With help from Wei Dong <weid@np.css.fujitsu.com>.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
YOSHIFUJI Hideaki authored and David S. Miller committed Feb 8, 2007
1 parent 2693256 commit a0d78eb
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions net/ipv6/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
struct net_device *dev = rt->rt6i_dev;
if (!oif || dev->ifindex == oif)
int ret = 0;

if (!oif)
return 2;
if ((dev->flags & IFF_LOOPBACK) &&
rt->rt6i_idev && rt->rt6i_idev->dev->ifindex == oif)
return 1;
return 0;
if (dev->flags & IFF_LOOPBACK) {
if (!WARN_ON(rt->rt6i_idev == NULL) &&
rt->rt6i_idev->dev->ifindex == oif)
ret = 1;
else
return 0;
}
if (dev->ifindex == oif)
return 2;

return ret;
}

static int inline rt6_check_neigh(struct rt6_info *rt)
Expand Down

0 comments on commit a0d78eb

Please sign in to comment.