summaryrefslogtreecommitdiffstats
path: root/src/core/cgroup.h
diff options
context:
space:
mode:
authorTopi Miettinen <toiwoton@gmail.com>2022-05-22 13:21:02 +0200
committerTopi Miettinen <topimiettinen@users.noreply.github.com>2022-06-08 18:12:25 +0200
commitc0548df0a2f78f3422d77c77c2149d8a7f50d8f6 (patch)
tree4e363ae5071b1c60622f3f8e9ffa621bbeff3150 /src/core/cgroup.h
parentnetwork: firewall integration with NFT sets (diff)
downloadsystemd-c0548df0a2f78f3422d77c77c2149d8a7f50d8f6.tar.xz
systemd-c0548df0a2f78f3422d77c77c2149d8a7f50d8f6.zip
core: firewall integration with ControlGroupNFTSet=
New directive `ControlGroupNFTSet=` provides a method for integrating services into firewall rules with NFT sets. Example: ``` table inet filter { ... set timesyncd { type cgroupsv2 } chain ntp_output { socket cgroupv2 != @timesyncd counter drop accept } ... } ``` /etc/systemd/system/systemd-timesyncd.service.d/override.conf ``` [Service] ControlGroupNFTSet=inet:filter:timesyncd ``` ``` $ sudo nft list set inet filter timesyncd table inet filter { set timesyncd { type cgroupsv2 elements = { "system.slice/systemd-timesyncd.service" } } } ```
Diffstat (limited to 'src/core/cgroup.h')
-rw-r--r--src/core/cgroup.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/cgroup.h b/src/core/cgroup.h
index 4413eeaaa0..6ac28d7ca7 100644
--- a/src/core/cgroup.h
+++ b/src/core/cgroup.h
@@ -6,6 +6,7 @@
#include "bpf-lsm.h"
#include "cgroup-util.h"
#include "cpu-set-util.h"
+#include "firewall-util.h"
#include "list.h"
#include "time-util.h"
@@ -194,6 +195,9 @@ struct CGroupContext {
ManagedOOMMode moom_mem_pressure;
uint32_t moom_mem_pressure_limit; /* Normalized to 2^32-1 == 100% */
ManagedOOMPreference moom_preference;
+
+ NFTSetContext *nft_set_context;
+ size_t n_nft_set_contexts;
};
/* Used when querying IP accounting data */