]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ip neigh: Add ifindex to request when filtering dumps by device
authorDavid Ahern <dsa@cumulusnetworks.com>
Wed, 7 Oct 2015 17:23:24 +0000 (10:23 -0700)
committerStephen Hemminger <shemming@brocade.com>
Mon, 12 Oct 2015 16:43:28 +0000 (09:43 -0700)
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>
ip/ipneigh.c

index b8973a2d0a0800a74caf7ed251bb9a9b85a4e885..ded514da642dcb00084345a81927ddd0ae07d176 100644 (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) {