summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHangbin Liu <liuhangbin@gmail.com>2017-06-16 11:31:52 +0800
committerStephen Hemminger <stephen@networkplumber.org>2017-06-16 09:01:02 -0700
commitad0a6a2c63fe78a133957b3e3ea2c39deb525444 (patch)
treec1051b4381ffddde2891e0d0c903cb4435efc7bb
parent3dc98cf2f51ffa2ebcc6c592aa95eae78d04d0c7 (diff)
downloadiproute2-ad0a6a2c63fe78a133957b3e3ea2c39deb525444.tar.gz
ip neigh: allow flush FAILED neighbour entry
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 <liuhangbin@gmail.com>
-rw-r--r--ip/ipneigh.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ip/ipneigh.c b/ip/ipneigh.c
index 4d8fc852..9c38a60d 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);