Commit b8c75324 authored by David Ahern's avatar David Ahern Committed by Stephen Hemminger

ip neigh: Add ifindex to request when filtering dumps by device

Add ifindex to dump request when filtering by device. If the kernel
supports it adding the index to the request limits the amount of data
the kernel pushes to userpsace.

The feature exists in userspace already, so no need to warn the user
if kernel side support does not exist. Using the kernel side filter
makes the request more efficient.
Signed-off-by: default avatarDavid Ahern <dsa@cumulusnetworks.com>
parent faa8a463
...@@ -419,6 +419,7 @@ static int do_show_or_flush(int argc, char **argv, int flush) ...@@ -419,6 +419,7 @@ static int do_show_or_flush(int argc, char **argv, int flush)
fprintf(stderr, "Cannot find device \"%s\"\n", filter_dev); fprintf(stderr, "Cannot find device \"%s\"\n", filter_dev);
return -1; return -1;
} }
addattr32(&req.n, sizeof(req), NDA_IFINDEX, filter.index);
} }
if (flush) { if (flush) {
......
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