Skip to content

Commit

Permalink
Enable ipv6 for rootless users by default
Browse files Browse the repository at this point in the history
Fixes containers/podman#10889

Inspired by @rugk

Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed Aug 25, 2021
1 parent 2dc0bbb commit 3e8a01a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/containers.conf.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,7 @@ and pods are visible.

Path to the slirp4netns binary.

**network_cmd_options**=[]
**network_cmd_options**=["enable_ipv6=true",]

Default options to pass to the slirp4netns binary.

Expand Down
5 changes: 5 additions & 0 deletions pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,10 @@ var _ = Describe("Config", func() {
"TERM=xterm",
}

networkCmdOptions := []string{
"enable_ipv6=true",
}

// Then
gomega.Expect(err).To(gomega.BeNil())
gomega.Expect(defaultConfig.Engine.CgroupManager).To(gomega.Equal("systemd"))
Expand All @@ -174,6 +178,7 @@ var _ = Describe("Config", func() {
gomega.Expect(defaultConfig.Engine.NumLocks).To(gomega.BeEquivalentTo(2048))
gomega.Expect(defaultConfig.Engine.OCIRuntimes).To(gomega.Equal(OCIRuntimeMap))
gomega.Expect(defaultConfig.Containers.HTTPProxy).To(gomega.Equal(false))
gomega.Expect(defaultConfig.Engine.NetworkCmdOptions).To(gomega.BeEquivalentTo(networkCmdOptions))
})

It("test GetDefaultEnvEx", func() {
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/containers.conf
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ default_sysctls = [
# Default options to pass to the slirp4netns binary.
# For example "allow_host_loopback=true"
#
#network_cmd_options = []
#network_cmd_options = ["enable_ipv6=true",]

# Whether to use chroot instead of pivot_root in the runtime
#
Expand Down
4 changes: 3 additions & 1 deletion pkg/config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,9 @@ func defaultConfigFromMemory() (*EngineConfig, error) {

c.CgroupManager = defaultCgroupManager()
c.StopTimeout = uint(10)

c.NetworkCmdOptions = []string{
"enable_ipv6=true",
}
c.Remote = isRemote()
c.OCIRuntimes = map[string][]string{
"crun": {
Expand Down

0 comments on commit 3e8a01a

Please sign in to comment.