Skip to contentSkip to conversation

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

PATCH Applied David Ahern 2 participants 2 messages Oct 7, 2015 – Oct 12, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
Kernel support was just picked up, 16660f0bd942, so here is the ip patch. This one depends on the earlier refactoring done for filtering by master device.

 ip/ipneigh.c | 1 +
 1 file changed, 1 insertion(+)
ip/ipneigh.c +1 -0
index b8973a2d0a08..ded514da642d 100644
@@ -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) {
Signature · 1 line
1.9.1
#1 lore raw
Quoted 9 lines · On Wed, 7 Oct 2015 10:23:24 -0700 David Ahern <[email protected]> wrote:

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.

Applied to net-next branch