From: David Ahern Date: Wed, 7 Oct 2015 17:23:24 +0000 (-0700) Subject: ip neigh: Add ifindex to request when filtering dumps by device X-Git-Tag: v4.4.0~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8c753245bad3f13a03b105b724ff406d278c753;p=thirdparty%2Fiproute2.git 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 --- diff --git a/ip/ipneigh.c b/ip/ipneigh.c index b8973a2d0..ded514da6 100644 --- a/ip/ipneigh.c +++ b/ip/ipneigh.c @@ -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) {