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: David Ahern <dsa@cumulusnetworks.com>
This commit is contained in:
David Ahern 2015-10-07 10:23:24 -07:00 committed by Stephen Hemminger
parent faa8a46300
commit b8c753245b
1 changed files with 1 additions and 0 deletions

View File

@ -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);
return -1;
}
addattr32(&req.n, sizeof(req), NDA_IFINDEX, filter.index);
}
if (flush) {