Commit d25ec03e authored by Phil Sutter's avatar Phil Sutter Committed by Stephen Hemminger

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: default avatarPhil Sutter <phil@nwl.cc>
parent 8e72880f
...@@ -1403,7 +1403,8 @@ static int ipaddr_flush(void) ...@@ -1403,7 +1403,8 @@ static int ipaddr_flush(void)
exit(1); exit(1);
} }
filter.flushed = 0; 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"); fprintf(stderr, "Flush terminated\n");
exit(1); exit(1);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment