diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/route.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 6ecb5e6fae2e..20083e0d3995 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -329,7 +329,7 @@ static inline int rt6_check_dev(struct rt6_info *rt, int oif) | |||
329 | static inline int rt6_check_neigh(struct rt6_info *rt) | 329 | static inline int rt6_check_neigh(struct rt6_info *rt) |
330 | { | 330 | { |
331 | struct neighbour *neigh = rt->rt6i_nexthop; | 331 | struct neighbour *neigh = rt->rt6i_nexthop; |
332 | int m = 0; | 332 | int m; |
333 | if (rt->rt6i_flags & RTF_NONEXTHOP || | 333 | if (rt->rt6i_flags & RTF_NONEXTHOP || |
334 | !(rt->rt6i_flags & RTF_GATEWAY)) | 334 | !(rt->rt6i_flags & RTF_GATEWAY)) |
335 | m = 1; | 335 | m = 1; |
@@ -337,10 +337,15 @@ static inline int rt6_check_neigh(struct rt6_info *rt) | |||
337 | read_lock_bh(&neigh->lock); | 337 | read_lock_bh(&neigh->lock); |
338 | if (neigh->nud_state & NUD_VALID) | 338 | if (neigh->nud_state & NUD_VALID) |
339 | m = 2; | 339 | m = 2; |
340 | else if (!(neigh->nud_state & NUD_FAILED)) | 340 | #ifdef CONFIG_IPV6_ROUTER_PREF |
341 | else if (neigh->nud_state & NUD_FAILED) | ||
342 | m = 0; | ||
343 | #endif | ||
344 | else | ||
341 | m = 1; | 345 | m = 1; |
342 | read_unlock_bh(&neigh->lock); | 346 | read_unlock_bh(&neigh->lock); |
343 | } | 347 | } else |
348 | m = 0; | ||
344 | return m; | 349 | return m; |
345 | } | 350 | } |
346 | 351 | ||