Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 22120
b: refs/heads/master
c: 8238dd0
h: refs/heads/master
v: v3
  • Loading branch information
YOSHIFUJI Hideaki authored and David S. Miller committed Mar 21, 2006
1 parent 97b29c7 commit 2f1d635
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 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: bb133964e036c4aaf773244468d589c024e7b399
refs/heads/master: 8238dd0698b480e432acd955c45f9f907b8d27de
28 changes: 18 additions & 10 deletions trunk/net/ipv6/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -414,23 +414,22 @@ void ip6_route_input(struct sk_buff *skb)
int strict;
int attempts = 3;
int err;
int reachable = RT6_SELECT_F_REACHABLE;

strict = ipv6_addr_type(&skb->nh.ipv6h->daddr) & (IPV6_ADDR_MULTICAST|IPV6_ADDR_LINKLOCAL) ? RT6_SELECT_F_IFACE : 0;

relookup:
read_lock_bh(&rt6_lock);

restart_2:
fn = fib6_lookup(&ip6_routing_table, &skb->nh.ipv6h->daddr,
&skb->nh.ipv6h->saddr);

restart:
rt = fn->leaf;

rt = rt6_select(&fn->leaf, skb->dev->ifindex, strict | RT6_SELECT_F_REACHABLE);
if (rt == &ip6_null_entry)
rt = rt6_select(&fn->leaf, skb->dev->ifindex, strict);
rt = rt6_select(&fn->leaf, skb->dev->ifindex, strict | reachable);
BACKTRACK();
if ((rt->rt6i_flags & RTF_CACHE))
if (rt == &ip6_null_entry ||
rt->rt6i_flags & RTF_CACHE)
goto out;

dst_hold(&rt->u.dst);
Expand Down Expand Up @@ -467,6 +466,10 @@ void ip6_route_input(struct sk_buff *skb)
goto relookup;

out:
if (reachable) {
reachable = 0;
goto restart_2;
}
dst_hold(&rt->u.dst);
read_unlock_bh(&rt6_lock);
out2:
Expand All @@ -483,20 +486,21 @@ struct dst_entry * ip6_route_output(struct sock *sk, struct flowi *fl)
int strict;
int attempts = 3;
int err;
int reachable = RT6_SELECT_F_REACHABLE;

strict = ipv6_addr_type(&fl->fl6_dst) & (IPV6_ADDR_MULTICAST|IPV6_ADDR_LINKLOCAL) ? RT6_SELECT_F_IFACE : 0;

relookup:
read_lock_bh(&rt6_lock);

restart_2:
fn = fib6_lookup(&ip6_routing_table, &fl->fl6_dst, &fl->fl6_src);

restart:
rt = rt6_select(&fn->leaf, fl->oif, strict | RT6_SELECT_F_REACHABLE);
if (rt == &ip6_null_entry)
rt = rt6_select(&fn->leaf, fl->oif, strict);
rt = rt6_select(&fn->leaf, fl->oif, strict | reachable);
BACKTRACK();
if ((rt->rt6i_flags & RTF_CACHE))
if (rt == &ip6_null_entry ||
rt->rt6i_flags & RTF_CACHE)
goto out;

dst_hold(&rt->u.dst);
Expand Down Expand Up @@ -533,6 +537,10 @@ struct dst_entry * ip6_route_output(struct sock *sk, struct flowi *fl)
goto relookup;

out:
if (reachable) {
reachable = 0;
goto restart_2;
}
dst_hold(&rt->u.dst);
read_unlock_bh(&rt6_lock);
out2:
Expand Down

0 comments on commit 2f1d635

Please sign in to comment.