Skip to content

Commit 802680e

Browse files
kerumetogvisor-bot
authored andcommitted
Added Nftables config option in runsc
This change adds a `nftables` flag, defaulting to false. This option will be used to enable support for nftables instead of iptables in the sandbox network setup. PiperOrigin-RevId: 766487742
1 parent 427f511 commit 802680e

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

runsc/config/config.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,6 +394,9 @@ type Config struct {
394394

395395
// SaveRestoreNetstack indicates whether netstack should be saved and restored.
396396
SaveRestoreNetstack bool `flag:"save-restore-netstack"`
397+
398+
// Nftables enables support for nftables to be used instead of iptables.
399+
Nftables bool `flag:"TESTONLY-nftables"`
397400
}
398401

399402
func (c *Config) validate() error {

runsc/config/flags.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ func RegisterFlags(flagSet *flag.FlagSet) {
134134
flagSet.Int("dcache", -1, "Set the global dentry cache size. This acts as a coarse-grained control on the number of host FDs simultaneously open by the sentry. If negative, per-mount caches are used.")
135135
flagSet.Bool("iouring", false, "TEST ONLY; Enables io_uring syscalls in the sentry. Support is experimental and very limited.")
136136
flagSet.Bool("directfs", true, "directly access the container filesystems from the sentry. Sentry runs with higher privileges.")
137+
flagSet.Bool("TESTONLY-nftables", false, "TEST ONLY; Enables nftables support in the sentry.")
137138

138139
// Flags that control sandbox runtime behavior: network related.
139140
flagSet.Var(networkTypePtr(NetworkSandbox), "network", "specifies which network to use: sandbox (default), host, none. Using network inside the sandbox is more secure because it's isolated from the host network.")

0 commit comments

Comments
 (0)