From 98cd35dbabb866743f2e4e0be8beccc086276831 Mon Sep 17 00:00:00 2001 From: Wang Sen Di Date: Wed, 3 Dec 2025 14:52:55 +0800 Subject: [PATCH] - --- netflow/iptables.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/netflow/iptables.sh b/netflow/iptables.sh index d108686..b573123 100644 --- a/netflow/iptables.sh +++ b/netflow/iptables.sh @@ -19,12 +19,19 @@ __get_mount_paths_cgroup_id() { } # __get_mount_paths_cgroup_id +__get_in_cgroup_ids() { + awk '$0 != 1' /sys/fs/cgroup/net_cls,net_prio/*/net_cls.classid +} + __main() { update-alternatives --set iptables /usr/sbin/iptables-legacy 2>/dev/null update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy 2>/dev/null readarray -t _cgroup_ids < <(__get_mount_paths_cgroup_id) - : + + if [[ ${#_cgroup_ids[@]} -eq 0 ]]; then + readarray -t _cgroup_ids < <(__get_in_cgroup_ids) + fi _owner_id=52000 _chain="output_netflow_owner_${_owner_id}"