diff options
author | Zheng Li <James.Z.Li@Dell.com> | 2024-04-16 17:53:43 +0800 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2024-04-18 12:01:03 +0200 |
commit | eabf425bc6ad32fa49cfb35c7bc59db07dfdd36e (patch) | |
tree | 2073a24b0ea57c70dfe2632938a70fca27a91743 /net/core/neighbour.c | |
parent | ba3de6d8035ef1efdd27e9a5047412f7cf3fb3a6 (diff) |
neighbour: guarantee the localhost connections be established successfully even the ARP table is full
Inter-process communication on localhost should be established successfully
even the ARP table is full, many processes on server machine use the
localhost to communicate such as command-line interface (CLI),
servers hope all CLI commands can be executed successfully even the arp
table is full. Right now CLI commands got timeout when the arp table is
full. Set the parameter of exempt_from_gc to be true for LOOPBACK net
device to keep localhost neigh in arp table, not removed by gc.
the steps of reproduced:
server with "gc_thresh3 = 1024" setting, ping server from more than 1024
same netmask Lan IPv4 addresses, run "ssh localhost" on console interface,
then the command will get timeout.
Signed-off-by: Zheng Li <James.Z.Li@Dell.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20240416095343.540-1-lizheng043@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Diffstat (limited to 'net/core/neighbour.c')
-rw-r--r-- | net/core/neighbour.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 552719c3bbc3..47d07b122f7a 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -734,7 +734,9 @@ out_neigh_release: struct neighbour *__neigh_create(struct neigh_table *tbl, const void *pkey, struct net_device *dev, bool want_ref) { - return ___neigh_create(tbl, pkey, dev, 0, false, want_ref); + bool exempt_from_gc = !!(dev->flags & IFF_LOOPBACK); + + return ___neigh_create(tbl, pkey, dev, 0, exempt_from_gc, want_ref); } EXPORT_SYMBOL(__neigh_create); |