nhorman / dropwatch

user space utility to interface to kernel dropwatch facility
GNU General Public License v2.0
632 stars 92 forks source link

Add support for net namespace filtering #75

Closed lorddoskias closed 1 year ago

lorddoskias commented 2 years ago

When investigating dropped packet issues on hosts running multiple containers it can be helpful to narrow down the search by either filtering for a specific container i.e. the inum of its net namespace, or just see the netnamespace where a particular drop originated from.

Introduce this support by extending the netlink protocol with the addition of NET_DM_ATTR_NS which configures the kernel-level component to filter based on the passed in id. The command has 3 variations:

This is the userspace code, the kernel can be found at https://lore.kernel.org/netdev/20221121133132.1837107-1-nikolay.borisov@virtuozzo.com/T/#m4795d0e1855d181043a7ee7bc57e72e0397ed838

Signed-off-by: Nikolay Borisov nikolay.borisov@virtuozzo.com