Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 103211
b: refs/heads/master
c: dd3abc4
h: refs/heads/master
i:
  103209: bf18b4d
  103207: 08bac39
v: v3
  • Loading branch information
YOSHIFUJI Hideaki committed Jul 3, 2008
1 parent 9332f75 commit 937cf01
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1b34be74cbf18f5d58cc85c7c4afcd9f7d74accd
refs/heads/master: dd3abc4ef52597ec8268274222574b2700ba3ded
20 changes: 16 additions & 4 deletions trunk/net/ipv6/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,20 @@ static inline int rt6_need_strict(struct in6_addr *daddr)

static inline struct rt6_info *rt6_device_match(struct net *net,
struct rt6_info *rt,
struct in6_addr *saddr,
int oif,
int flags)
{
struct rt6_info *local = NULL;
struct rt6_info *sprt;

if (oif) {
for (sprt = rt; sprt; sprt = sprt->u.dst.rt6_next) {
struct net_device *dev = sprt->rt6i_dev;
if (!oif && ipv6_addr_any(saddr))
goto out;

for (sprt = rt; sprt; sprt = sprt->u.dst.rt6_next) {
struct net_device *dev = sprt->rt6i_dev;

if (oif) {
if (dev->ifindex == oif)
return sprt;
if (dev->flags & IFF_LOOPBACK) {
Expand All @@ -259,14 +264,21 @@ static inline struct rt6_info *rt6_device_match(struct net *net,
}
local = sprt;
}
} else {
if (ipv6_chk_addr(net, saddr, dev,
flags & RT6_LOOKUP_F_IFACE))
return sprt;
}
}

if (oif) {
if (local)
return local;

if (flags & RT6_LOOKUP_F_IFACE)
return net->ipv6.ip6_null_entry;
}
out:
return rt;
}

Expand Down Expand Up @@ -539,7 +551,7 @@ static struct rt6_info *ip6_pol_route_lookup(struct net *net,
fn = fib6_lookup(&table->tb6_root, &fl->fl6_dst, &fl->fl6_src);
restart:
rt = fn->leaf;
rt = rt6_device_match(net, rt, fl->oif, flags);
rt = rt6_device_match(net, rt, &fl->fl6_src, fl->oif, flags);
BACKTRACK(net, &fl->fl6_src);
out:
dst_use(&rt->u.dst, jiffies);
Expand Down

0 comments on commit 937cf01

Please sign in to comment.