Thread (5 messages) flat view 5 messages, 4 authors, 2021-06-07

Re: [PATCH net] neighbour: allow NUD_NOARP entries to be forced GCed

From: Roopa Prabhu <hidden>
Date: 2021-06-07 18:53:18

On 6/7/21 10:35 AM, David Ahern wrote:
IFF_POINTOPOINT interfaces use NUD_NOARP entries for IPv6. It's possible to
fill up the neighbour table with enough entries that it will overflow for
valid connections after that.

This behaviour is more prevalent after commit 58956317c8de ("neighbor:
Improve garbage collection") is applied, as it prevents removal from
entries that are not NUD_FAILED, unless they are more than 5s old.

Fixes: 58956317c8de (neighbor: Improve garbage collection)
Reported-by: Kasper Dupont <redacted>
Signed-off-by: Thadeu Lima de Souza Cascardo <redacted>
Signed-off-by: David Ahern <dsahern@kernel.org>
---
rebased to net tree

There are other use-cases  that use NUD_NOARP as static neighbour 
entries which should be exempt from forced gc.

for example when qualified by NTF_EXT_LEARNED for the E-VPN use-case.

The check in your patch below should exclude NTF_EXT_LEARNED entries.


(unrelated to the neighbour code ,  but bridge driver also uses 
NUD_NOARP for static entries)

quoted hunk ↗ jump to hunk
  net/core/neighbour.c | 1 +
  1 file changed, 1 insertion(+)
diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 98f20efbfadf..bf774575ad71 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -238,6 +238,7 @@ static int neigh_forced_gc(struct neigh_table *tbl)
  
  			write_lock(&n->lock);
  			if ((n->nud_state == NUD_FAILED) ||
+			    (n->nud_state == NUD_NOARP) ||
  			    (tbl->is_multicast &&
  			     tbl->is_multicast(n->primary_key)) ||
  			    time_after(tref, n->updated))
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help