aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/fib_semantics.c
diff options
context:
space:
mode:
authorDavid Ahern <dsahern@gmail.com>2019-04-05 19:30:38 -0400
committerDavid S. Miller <davem@davemloft.net>2019-04-08 18:22:41 -0400
commit1a38c43d319e745cf12055a266a1f459e2ba9ec3 (patch)
treed0eb6c2d1324b3c1602003ea351f08dbbfc7ddc8 /net/ipv4/fib_semantics.c
parent619d1826269b4be5c992bec0029bbfcc823d663d (diff)
ipv4: Handle ipv6 gateway in fib_good_nh
Update fib_good_nh to handle an ipv6 gateway. Signed-off-by: David Ahern <dsahern@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/fib_semantics.c')
-rw-r--r--net/ipv4/fib_semantics.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index e5a6d431bfab..c1ea138335a2 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -1909,8 +1909,14 @@ static bool fib_good_nh(const struct fib_nh *nh)
1909 1909
1910 rcu_read_lock_bh(); 1910 rcu_read_lock_bh();
1911 1911
1912 n = __ipv4_neigh_lookup_noref(nh->fib_nh_dev, 1912 if (likely(nh->fib_nh_gw_family == AF_INET))
1913 (__force u32)nh->fib_nh_gw4); 1913 n = __ipv4_neigh_lookup_noref(nh->fib_nh_dev,
1914 (__force u32)nh->fib_nh_gw4);
1915 else if (nh->fib_nh_gw_family == AF_INET6)
1916 n = __ipv6_neigh_lookup_noref_stub(nh->fib_nh_dev,
1917 &nh->fib_nh_gw6);
1918 else
1919 n = NULL;
1914 if (n) 1920 if (n)
1915 state = n->nud_state; 1921 state = n->nud_state;
1916 1922