From ad0a6a2c63fe78a133957b3e3ea2c39deb525444 Mon Sep 17 00:00:00 2001 From: Hangbin Liu Date: Fri, 16 Jun 2017 11:31:52 +0800 Subject: [PATCH 1/2] 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 --- ip/ipneigh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); From e4319590f70b0b9ed2beebafaacb323ecf781e50 Mon Sep 17 00:00:00 2001 From: David Lebrun Date: Fri, 16 Jun 2017 15:54:28 +0200 Subject: [PATCH 2/2] iproute: fix compilation issue with older glibc If a header that includes linux/in6.h is included before iproute's utils.h, then iproute2 fails to compile on older glibc versions. Fixes: e8493916a8ede9970732e33ea52d30b83071f401 ("iproute: add support for SR-IPv6 lwtunnel encapsulation") Reported-by: Daniel Borkmann Signed-off-by: David Lebrun --- ip/iproute_lwtunnel.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/ip/iproute_lwtunnel.c b/ip/iproute_lwtunnel.c index 1395f033..5c0c7d11 100644 --- a/ip/iproute_lwtunnel.c +++ b/ip/iproute_lwtunnel.c @@ -19,13 +19,6 @@ #include #include #include - -#ifndef __USE_KERNEL_IPV6_DEFS -#define __USE_KERNEL_IPV6_DEFS -#endif -#include -#include -#include #include #include "rt_names.h" @@ -33,6 +26,10 @@ #include "iproute_lwtunnel.h" #include "bpf_util.h" +#include +#include +#include + static const char *format_encap_type(int type) { switch (type) {