diff options
author | David Ahern <dsahern@gmail.com> | 2019-04-09 14:41:11 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-11 14:24:06 -0700 |
commit | 6e1809a564ef743052157b78f47b40a2b8373458 (patch) | |
tree | 206fc3ac8dfb15a24e140248a7b1c2baa26b96cc /net | |
parent | 1ba9a8951794751ea3bcbcc5df700d42d525a130 (diff) |
ipv6: Remove rt6_check_dev
rt6_check_dev is a simpler helper with only 1 caller. Fold the code
into rt6_score_route.
Signed-off-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/route.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index b515fa8f787e..9630339d4b76 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -580,15 +580,6 @@ static inline void rt6_probe(struct fib6_info *rt) /* * Default Router Selection (RFC 2461 6.3.6) */ -static inline int rt6_check_dev(struct fib6_info *rt, int oif) -{ - const struct net_device *dev = rt->fib6_nh.fib_nh_dev; - - if (!oif || dev->ifindex == oif) - return 2; - return 0; -} - static enum rt6_nud_state rt6_check_neigh(const struct fib6_nh *fib6_nh) { enum rt6_nud_state ret = RT6_NUD_FAIL_HARD; @@ -620,9 +611,11 @@ static enum rt6_nud_state rt6_check_neigh(const struct fib6_nh *fib6_nh) static int rt6_score_route(struct fib6_info *rt, int oif, int strict) { struct fib6_nh *nh = &rt->fib6_nh; - int m; + int m = 0; + + if (!oif || nh->fib_nh_dev->ifindex == oif) + m = 2; - m = rt6_check_dev(rt, oif); if (!m && (strict & RT6_LOOKUP_F_IFACE)) return RT6_NUD_FAIL_HARD; #ifdef CONFIG_IPV6_ROUTER_PREF |