Skip to content

Commit 3e8a01a

Browse files
committed
Enable ipv6 for rootless users by default
Fixes containers/podman#10889 Inspired by @rugk Signed-off-by: Daniel J Walsh <[email protected]>
1 parent 2dc0bbb commit 3e8a01a

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

docs/containers.conf.5.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ and pods are visible.
433433

434434
Path to the slirp4netns binary.
435435

436-
**network_cmd_options**=[]
436+
**network_cmd_options**=["enable_ipv6=true",]
437437

438438
Default options to pass to the slirp4netns binary.
439439

pkg/config/config_test.go

+5
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,10 @@ var _ = Describe("Config", func() {
165165
"TERM=xterm",
166166
}
167167

168+
networkCmdOptions := []string{
169+
"enable_ipv6=true",
170+
}
171+
168172
// Then
169173
gomega.Expect(err).To(gomega.BeNil())
170174
gomega.Expect(defaultConfig.Engine.CgroupManager).To(gomega.Equal("systemd"))
@@ -174,6 +178,7 @@ var _ = Describe("Config", func() {
174178
gomega.Expect(defaultConfig.Engine.NumLocks).To(gomega.BeEquivalentTo(2048))
175179
gomega.Expect(defaultConfig.Engine.OCIRuntimes).To(gomega.Equal(OCIRuntimeMap))
176180
gomega.Expect(defaultConfig.Containers.HTTPProxy).To(gomega.Equal(false))
181+
gomega.Expect(defaultConfig.Engine.NetworkCmdOptions).To(gomega.BeEquivalentTo(networkCmdOptions))
177182
})
178183

179184
It("test GetDefaultEnvEx", func() {

pkg/config/containers.conf

+1-1
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ default_sysctls = [
407407
# Default options to pass to the slirp4netns binary.
408408
# For example "allow_host_loopback=true"
409409
#
410-
#network_cmd_options = []
410+
#network_cmd_options = ["enable_ipv6=true",]
411411

412412
# Whether to use chroot instead of pivot_root in the runtime
413413
#

pkg/config/default.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,9 @@ func defaultConfigFromMemory() (*EngineConfig, error) {
257257

258258
c.CgroupManager = defaultCgroupManager()
259259
c.StopTimeout = uint(10)
260-
260+
c.NetworkCmdOptions = []string{
261+
"enable_ipv6=true",
262+
}
261263
c.Remote = isRemote()
262264
c.OCIRuntimes = map[string][]string{
263265
"crun": {

0 commit comments

Comments
 (0)