Skip to content

Commit 5eea3a6

Browse files
guodeqing-hwdavem330
authored andcommitted
net: Fix the arp error in some cases
ie., $ ifconfig eth0 6.6.6.6 netmask 255.255.255.0 $ ip rule add from 6.6.6.6 table 6666 $ ip route add 9.9.9.9 via 6.6.6.6 $ ping -I 6.6.6.6 9.9.9.9 PING 9.9.9.9 (9.9.9.9) from 6.6.6.6 : 56(84) bytes of data. 3 packets transmitted, 0 received, 100% packet loss, time 2079ms $ arp Address HWtype HWaddress Flags Mask Iface 6.6.6.6 (incomplete) eth0 The arp request address is error, this is because fib_table_lookup in fib_check_nh lookup the destnation 9.9.9.9 nexthop, the scope of the fib result is RT_SCOPE_LINK,the correct scope is RT_SCOPE_HOST. Here I add a check of whether this is RT_TABLE_MAIN to solve this problem. Fixes: 3bfd847 ("net: Use passed in table for nexthop lookups") Signed-off-by: guodeqing <[email protected]> Reviewed-by: David Ahern <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ad103e0 commit 5eea3a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/fib_semantics.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ static int fib_check_nh_v4_gw(struct net *net, struct fib_nh *nh, u32 table,
11091109
if (fl4.flowi4_scope < RT_SCOPE_LINK)
11101110
fl4.flowi4_scope = RT_SCOPE_LINK;
11111111

1112-
if (table)
1112+
if (table && table != RT_TABLE_MAIN)
11131113
tbl = fib_get_table(net, table);
11141114

11151115
if (tbl)

0 commit comments

Comments
 (0)