From: Phil Sutter Date: Tue, 24 Nov 2015 14:31:02 +0000 (+0100) Subject: ipaddress: fix ipaddr_flush for Linux >= 3.1 X-Git-Tag: v4.4.0~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d25ec03e1dce4cf22093a9f7106e9401ab5bf066;p=thirdparty%2Fiproute2.git ipaddress: fix ipaddr_flush for Linux >= 3.1 Linux version 3.1 introduced a consistency check for netlink dumps in commit 670dc28 ("netlink: advertise incomplete dumps"). This bites iproute2 when flushing more addresses than can fit into a single RTM_GETADDR response. To silence the spurious error message "Dump was interrupted and may be inconsistent.", advise rtnl_dump_filter_l() to not care about NLM_F_DUMP_INTR. Signed-off-by: Phil Sutter --- diff --git a/ip/ipaddress.c b/ip/ipaddress.c index 26e91c9b5..9811eb4c7 100644 --- a/ip/ipaddress.c +++ b/ip/ipaddress.c @@ -1403,7 +1403,8 @@ static int ipaddr_flush(void) exit(1); } filter.flushed = 0; - if (rtnl_dump_filter(&rth, print_addrinfo, stdout) < 0) { + if (rtnl_dump_filter_nc(&rth, print_addrinfo, + stdout, NLM_F_DUMP_INTR) < 0) { fprintf(stderr, "Flush terminated\n"); exit(1); }