Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 341745
b: refs/heads/master
c: a5a81f0
h: refs/heads/master
i:
  341743: 692f0b3
v: v3
  • Loading branch information
Paul Marks authored and David S. Miller committed Dec 3, 2012
1 parent 1cb23d0 commit 3d009b1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 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: 5d097109257c03a71845729f8db6b5770c4bbedc
refs/heads/master: a5a81f0b9025867efb999d14a8dfc1907c5a4c3b
24 changes: 10 additions & 14 deletions trunk/net/ipv6/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,44 +544,40 @@ static inline int rt6_check_dev(struct rt6_info *rt, int oif)
return 0;
}

static inline int rt6_check_neigh(struct rt6_info *rt)
static inline bool rt6_check_neigh(struct rt6_info *rt)
{
struct neighbour *neigh;
int m;
bool ret = false;

neigh = rt->n;
if (rt->rt6i_flags & RTF_NONEXTHOP ||
!(rt->rt6i_flags & RTF_GATEWAY))
m = 1;
ret = true;
else if (neigh) {
read_lock_bh(&neigh->lock);
if (neigh->nud_state & NUD_VALID)
m = 2;
ret = true;
#ifdef CONFIG_IPV6_ROUTER_PREF
else if (neigh->nud_state & NUD_FAILED)
m = 0;
else if (!(neigh->nud_state & NUD_FAILED))
ret = true;
#endif
else
m = 1;
read_unlock_bh(&neigh->lock);
} else
m = 0;
return m;
}
return ret;
}

static int rt6_score_route(struct rt6_info *rt, int oif,
int strict)
{
int m, n;
int m;

m = rt6_check_dev(rt, oif);
if (!m && (strict & RT6_LOOKUP_F_IFACE))
return -1;
#ifdef CONFIG_IPV6_ROUTER_PREF
m |= IPV6_DECODE_PREF(IPV6_EXTRACT_PREF(rt->rt6i_flags)) << 2;
#endif
n = rt6_check_neigh(rt);
if (!n && (strict & RT6_LOOKUP_F_REACHABLE))
if (!rt6_check_neigh(rt) && (strict & RT6_LOOKUP_F_REACHABLE))
return -1;
return m;
}
Expand Down

0 comments on commit 3d009b1

Please sign in to comment.