Skip to content

Commit 6e1809a

Browse files
dsaherndavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 1ba9a89 commit 6e1809a

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

net/ipv6/route.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -580,15 +580,6 @@ static inline void rt6_probe(struct fib6_info *rt)
580580
/*
581581
* Default Router Selection (RFC 2461 6.3.6)
582582
*/
583-
static inline int rt6_check_dev(struct fib6_info *rt, int oif)
584-
{
585-
const struct net_device *dev = rt->fib6_nh.fib_nh_dev;
586-
587-
if (!oif || dev->ifindex == oif)
588-
return 2;
589-
return 0;
590-
}
591-
592583
static enum rt6_nud_state rt6_check_neigh(const struct fib6_nh *fib6_nh)
593584
{
594585
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)
620611
static int rt6_score_route(struct fib6_info *rt, int oif, int strict)
621612
{
622613
struct fib6_nh *nh = &rt->fib6_nh;
623-
int m;
614+
int m = 0;
615+
616+
if (!oif || nh->fib_nh_dev->ifindex == oif)
617+
m = 2;
624618

625-
m = rt6_check_dev(rt, oif);
626619
if (!m && (strict & RT6_LOOKUP_F_IFACE))
627620
return RT6_NUD_FAIL_HARD;
628621
#ifdef CONFIG_IPV6_ROUTER_PREF

0 commit comments

Comments
 (0)