From: David Decotigny <decot+git@google.com>
To: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Nikolay Aleksandrov <razor@blackwall.org>,
David Ahern <dsahern@kernel.org>,
"Denis V. Lunev" <den@openvz.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Chen Zhongjin <chenzhongjin@huawei.com>,
David Decotigny <ddecotig@google.com>,
Yuwei Wang <wangyuweihx@gmail.com>,
Alexander Mikhalitsyn <alexander.mikhalitsyn@virtuozzo.com>,
Thomas Zeitlhofer <thomas.zeitlhofer+lkml@ze-it.at>
Subject: [PATCH v1 1/1] net: neigh: persist proxy config across link flaps
Date: Mon, 12 Dec 2022 23:38:01 -0800 [thread overview]
Message-ID: <20221213073801.361500-1-decot+git@google.com> (raw)
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
next reply other threads:[~2022-12-13 7:38 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-13 7:38 David Decotigny [this message]
2022-12-15 4:48 ` [PATCH v1 1/1] net: neigh: persist proxy config across link flaps 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221213073801.361500-1-decot+git@google.com \
--to=decot+git@google.com \
--cc=alexander.mikhalitsyn@virtuozzo.com \
--cc=chenzhongjin@huawei.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=ddecotig@google.com \
--cc=den@openvz.org \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=razor@blackwall.org \
--cc=thomas.zeitlhofer+lkml@ze-it.at \
--cc=wangyuweihx@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).