All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/1] net: neigh: persist proxy config across link flaps
@ 2022-12-13  7:38 David Decotigny
  2022-12-15  4:48 ` Jakub Kicinski
  0 siblings, 1 reply; 7+ messages in thread
From: David Decotigny @ 2022-12-13  7:38 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	netdev, linux-kernel
  Cc: Nikolay Aleksandrov, David Ahern, Denis V. Lunev,
	Daniel Borkmann, Chen Zhongjin, David Decotigny, Yuwei Wang,
	Alexander Mikhalitsyn, Thomas Zeitlhofer

From: David Decotigny <ddecotig@google.com>

Without this patch, the 'ip neigh add proxy' config is lost when the
cable or peer disappear, ie. when the link goes down while staying
admin up. When the link comes back, the config is never recovered.

This patch makes sure that such an nd proxy config survives a switch
or cable issue.

Signed-off-by: David Decotigny <ddecotig@google.com>


---
 net/core/neighbour.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 952a54763358..5ad7ac674daa 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -426,7 +426,10 @@ static int __neigh_ifdown(struct neigh_table *tbl, struct net_device *dev,
 {
 	write_lock_bh(&tbl->lock);
 	neigh_flush_dev(tbl, dev, skip_perm);
-	pneigh_ifdown_and_unlock(tbl, dev);
+	if (skip_perm)
+		write_unlock_bh(&tbl->lock);
+	else
+		pneigh_ifdown_and_unlock(tbl, dev);
 	pneigh_queue_purge(&tbl->proxy_queue, dev ? dev_net(dev) : NULL,
 			   tbl->family);
 	if (skb_queue_empty_lockless(&tbl->proxy_queue))
-- 
2.39.0.rc1.256.g54fd8350bd-goog


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-12-15 23:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-13  7:38 [PATCH v1 1/1] net: neigh: persist proxy config across link flaps David Decotigny
2022-12-15  4:48 ` Jakub Kicinski
2022-12-15  5:34   ` Mahesh Bandewar (महेश बंडेवार)
     [not found]     ` <CAG88wWbZ3eXCFJBZ8mrfvddKiVihF-GfEOYAOmT_7VX_AeOoqQ@mail.gmail.com>
2022-12-15 19:05       ` Jakub Kicinski
2022-12-15 20:36         ` David Decotigny
2022-12-15 21:16           ` Jakub Kicinski
2022-12-15 23:14             ` David Ahern

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.