From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roopa Prabhu Subject: [PATCH net-next] neighbour: force neigh_invalidate when NUD_FAILED update is from admin Date: Mon, 25 Jun 2018 20:32:53 -0700 Message-ID: <1529983973-5508-1-git-send-email-roopa@cumulusnetworks.com> Cc: netdev@vger.kernel.org To: davem@davemloft.net Return-path: Received: from mail-pl0-f47.google.com ([209.85.160.47]:35559 "EHLO mail-pl0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965262AbeFZDdB (ORCPT ); Mon, 25 Jun 2018 23:33:01 -0400 Received: by mail-pl0-f47.google.com with SMTP id k1-v6so7829369plt.2 for ; Mon, 25 Jun 2018 20:33:01 -0700 (PDT) Sender: netdev-owner@vger.kernel.org List-ID: From: Roopa Prabhu In systems where neigh gc thresh holds are set to high values, admin deleted neigh entries (eg ip neigh flush or ip neigh del) can linger around in NUD_FAILED state for a long time until periodic gc kicks in. This patch forces neigh_invalidate when NUD_FAILED neigh_update is from an admin. Signed-off-by: Roopa Prabhu --- My testing has not shown any problems with this patch. But i am not sure why historically neigh admin was not considered here: I am assuming that it is because the problem is not very obvious in default low gc threshold deployments. net/core/neighbour.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/core/neighbour.c b/net/core/neighbour.c index 8e3fda9..cbe85d8 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -1148,7 +1148,8 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new, neigh->nud_state = new; err = 0; notify = old & NUD_VALID; - if ((old & (NUD_INCOMPLETE | NUD_PROBE)) && + if (((old & (NUD_INCOMPLETE | NUD_PROBE)) || + (flags & NEIGH_UPDATE_F_ADMIN)) && (new & NUD_FAILED)) { neigh_invalidate(neigh); notify = 1; -- 2.1.4