From patchwork Fri Jun 16 03:31:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hangbin Liu X-Patchwork-Id: 776535 X-Patchwork-Delegate: shemminger@vyatta.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3wpmC03fpDz9s8J for ; Fri, 16 Jun 2017 13:32:12 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Dq96OJvC"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752063AbdFPDcK (ORCPT ); Thu, 15 Jun 2017 23:32:10 -0400 Received: from mail-pf0-f193.google.com ([209.85.192.193]:33478 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750792AbdFPDcJ (ORCPT ); Thu, 15 Jun 2017 23:32:09 -0400 Received: by mail-pf0-f193.google.com with SMTP id w12so3763183pfk.0 for ; Thu, 15 Jun 2017 20:32:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lExeyaOvb4xwv2ouMLjW+AxLopjtl61JTDvN9rCtl+k=; b=Dq96OJvCfs1G3kLRBoDRIMNRwNHkJ2PlDuwu9vwb8Yhlcb7p4XbiQXXxw8zSBILbrc 3SOMxNaH2UCW2/seWUjGB+5KJW36WCooOXYnFw+iaOWXPL5aqvVCsSU0YH7iBTQb0AWH 6ZCSkeNl9qeDyqvl2nLjZT3MfR2e5tJ+8RgRglTVKmGxpD98B4QRKVfJ88JRefkY7MiT gRipzqvtQixLQeIt7FDmwslSB8XkWl79uXlUEUigqAv6KNM8LAHGj66oXFge5nsFp5T6 rjmM79xgCAbJBjqVjVHpHVjTSJNL0Pvk977CiNGEXV+A6nvhOIZEdE36ErDeWJnEmw1S 8o7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=lExeyaOvb4xwv2ouMLjW+AxLopjtl61JTDvN9rCtl+k=; b=UGkvLB09i5vPi8GNQsZUFJkOdTCgMXPfV+3ZLIEAIHyE1fuak+fm/3bQdKtkOmOuXu 4YXQYux+Y22fMmhQU4XWF53M3sgNA0Ge4ZWVi5bhofi+HLuMFbNIHbyxq9BXWu5K8zIp lsTtu3rRPCelab//tZ3PEPtdpgB9D4C/SaVFdExryQUPsClBx7Xl1IX8wBHVp3T+1iHi wyEphoOkuyiEBC7KdN22HlUWNznCQ10hRywWH+2ZXhCV0YHOkw4P3LhECAqTY3T25wHd AqAQFPG1Ok7qot4/wTRoOXjdrmQs/4VzpEUJVSiBH7+i7qds7WuzugADhMNy/ZFqlLK+ 8Buw== X-Gm-Message-State: AKS2vOy6zZcuxUTZA0BA+axUGdZpfuw7ffC1dSsik/FgOQ8qDNXighOk MbWDd/dtnFLOshLt X-Received: by 10.99.104.199 with SMTP id d190mr9007082pgc.185.1497583928328; Thu, 15 Jun 2017 20:32:08 -0700 (PDT) Received: from leo.usersys.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id y8sm1233698pge.0.2017.06.15.20.32.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Jun 2017 20:32:07 -0700 (PDT) From: Hangbin Liu To: netdev@vger.kernel.org Cc: Stephen Hemminger , Hangbin Liu Subject: [PATCHv2 iproute2 net-next] ip neigh: allow flush FAILED neighbour entry Date: Fri, 16 Jun 2017 11:31:52 +0800 Message-Id: <1497583912-27981-1-git-send-email-liuhangbin@gmail.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1496651489-28110-1-git-send-email-liuhangbin@gmail.com> References: <1496651489-28110-1-git-send-email-liuhangbin@gmail.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org After upstream commit 5071034e4af7 ('neigh: Really delete an arp/neigh entry on "ip neigh delete" or "arp -d"'), we could delete a single FAILED neighbour entry now. But `ip neigh flush` still skip the FAILED entry. Move the filter after first round flush so we can flush FAILED entry on fixed kernel and also do not keep retrying on old kernel. Signed-off-by: Hangbin Liu --- ip/ipneigh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ip/ipneigh.c b/ip/ipneigh.c index 4d8fc85..9c38a60 100644 --- a/ip/ipneigh.c +++ b/ip/ipneigh.c @@ -445,7 +445,6 @@ static int do_show_or_flush(int argc, char **argv, int flush) filter.flushb = flushb; filter.flushp = 0; filter.flushe = sizeof(flushb); - filter.state &= ~NUD_FAILED; while (round < MAX_ROUNDS) { if (rtnl_dump_request_n(&rth, &req.n) < 0) { @@ -474,6 +473,7 @@ static int do_show_or_flush(int argc, char **argv, int flush) printf("\n*** Round %d, deleting %d entries ***\n", round, filter.flushed); fflush(stdout); } + filter.state &= ~NUD_FAILED; } printf("*** Flush not complete bailing out after %d rounds\n", MAX_ROUNDS);