datatype: skip cgroupv2 rootfs in listing
Pablo Neira Ayuso
maintainerPATCH v2 1/1 datatype: skip cgroupv2 rootfs in listing
cgroupv2 path is expressed from the /sys/fs/cgroup, update listing to skip the rootfs.
# nft add rule x y socket cgroupv2 level 1 "user.slice" counter
# nft list ruleset
table ip x {
chain y {
type filter hook input priority filter; policy accept;
socket cgroupv2 level 1 "user.slice" counter
}
}Signed-off-by Pablo Neira Ayuso <[email protected]>
---
v2: update commit description.
src/datatype.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
src/datatype.c +2 -1
@@ -1382,7 +1382,8 @@ static void cgroupv2_type_print(const struct expr *expr, cgroup_path =cgroupv2_get_path (SYSFS_CGROUPSV2_PATH , id);if (cgroup_path) -nft_print (octx,"\"%s\"" , cgroup_path); +nft_print (octx,"\"%s\"" , + &cgroup_path[strlen (SYSFS_CGROUPSV2_PATH ) +1 ]);else nft_print (octx,"%" PRIu64, id);
Signature · 1 line
2.30.2