Commit 1c346dcc authored by Jeff Harris's avatar Jeff Harris Committed by Stephen Hemminger

ip: neigh: Fix leftover attributes message during flush

Use the same rtnl_dump_request_n call as the show.  The rtnl_wilddump_request
assumes the type uses an ifinfomsg which is not the case for the neighbor
table.
Signed-off-by: default avatarJeff Harris <jefftharris@gmail.com>
Acked-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
parent bbac6c63
...@@ -430,6 +430,8 @@ static int do_show_or_flush(int argc, char **argv, int flush) ...@@ -430,6 +430,8 @@ static int do_show_or_flush(int argc, char **argv, int flush)
addattr32(&req.n, sizeof(req), NDA_IFINDEX, filter.index); addattr32(&req.n, sizeof(req), NDA_IFINDEX, filter.index);
} }
req.ndm.ndm_family = filter.family;
if (flush) { if (flush) {
int round = 0; int round = 0;
char flushb[4096-512]; char flushb[4096-512];
...@@ -440,7 +442,7 @@ static int do_show_or_flush(int argc, char **argv, int flush) ...@@ -440,7 +442,7 @@ static int do_show_or_flush(int argc, char **argv, int flush)
filter.state &= ~NUD_FAILED; filter.state &= ~NUD_FAILED;
while (round < MAX_ROUNDS) { while (round < MAX_ROUNDS) {
if (rtnl_wilddump_request(&rth, filter.family, RTM_GETNEIGH) < 0) { if (rtnl_dump_request_n(&rth, &req.n) < 0) {
perror("Cannot send dump request"); perror("Cannot send dump request");
exit(1); exit(1);
} }
...@@ -472,8 +474,6 @@ static int do_show_or_flush(int argc, char **argv, int flush) ...@@ -472,8 +474,6 @@ static int do_show_or_flush(int argc, char **argv, int flush)
return 1; return 1;
} }
req.ndm.ndm_family = filter.family;
if (rtnl_dump_request_n(&rth, &req.n) < 0) { if (rtnl_dump_request_n(&rth, &req.n) < 0) {
perror("Cannot send dump request"); perror("Cannot send dump request");
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