Skip to content

Commit

Permalink
vendor: docker/libnetwork b3507428be5b458cb0e2b4086b13531fb0706e46
Browse files Browse the repository at this point in the history
full diff: moby/libnetwork@fa125a3...b350742

- fixed IPv6 iptables rules for enabled firewalld (libnetwork#2609)
    - fixes "Docker uses 'iptables' instead of 'ip6tables' for IPv6 NAT rule, crashes"
- Fix regression in docker-proxy
    - introduced in "Fix IPv6 Port Forwarding for the Bridge Driver" (libnetwork#2604)
    - fixes/addresses: "IPv4 and IPv6 addresses are not bound by default anymore" (libnetwork#2607)
    - fixes/addresses "IPv6 is no longer proxied by default anymore" (moby#41858)
- Use hostIP to decide on Portmapper version
    - fixes docker-proxy not being stopped correctly

Port mapping of containers now contain separatet mappings for IPv4 and IPv6 addresses, when
listening on "any" IP address. Various tests had to be updated to take multiple mappings into
account.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 0450728)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
thaJeztah authored and nosamad committed Sep 13, 2021
1 parent d2763cf commit 3d77885
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 18 deletions.
2 changes: 1 addition & 1 deletion hack/dockerfile/install/proxy.installer
Expand Up @@ -3,7 +3,7 @@
# LIBNETWORK_COMMIT is used to build the docker-userland-proxy binary. When
# updating the binary version, consider updating github.com/docker/libnetwork
# in vendor.conf accordingly
: "${LIBNETWORK_COMMIT:=fa125a3512ee0f6187721c88582bf8c4378bd4d7}"
: "${LIBNETWORK_COMMIT:=b3507428be5b458cb0e2b4086b13531fb0706e46}"

install_proxy() {
case "$1" in
Expand Down
26 changes: 20 additions & 6 deletions integration-cli/docker_cli_port_test.go
Expand Up @@ -20,13 +20,13 @@ func (s *DockerSuite) TestPortList(c *testing.T) {

out, _ = dockerCmd(c, "port", firstID, "80")

err := assertPortList(c, out, []string{"0.0.0.0:9876"})
err := assertPortList(c, out, []string{"0.0.0.0:9876", "[::]:9876"})
// Port list is not correct
assert.NilError(c, err)

out, _ = dockerCmd(c, "port", firstID)

err = assertPortList(c, out, []string{"80/tcp -> 0.0.0.0:9876"})
err = assertPortList(c, out, []string{"80/tcp -> 0.0.0.0:9876", "80/tcp -> [::]:9876"})
// Port list is not correct
assert.NilError(c, err)

Expand All @@ -42,16 +42,19 @@ func (s *DockerSuite) TestPortList(c *testing.T) {

out, _ = dockerCmd(c, "port", ID, "80")

err = assertPortList(c, out, []string{"0.0.0.0:9876"})
err = assertPortList(c, out, []string{"0.0.0.0:9876", "[::]:9876"})
// Port list is not correct
assert.NilError(c, err)

out, _ = dockerCmd(c, "port", ID)

err = assertPortList(c, out, []string{
"80/tcp -> 0.0.0.0:9876",
"80/tcp -> [::]:9876",
"81/tcp -> 0.0.0.0:9877",
"81/tcp -> [::]:9877",
"82/tcp -> 0.0.0.0:9878",
"82/tcp -> [::]:9878",
})
// Port list is not correct
assert.NilError(c, err)
Expand All @@ -69,7 +72,7 @@ func (s *DockerSuite) TestPortList(c *testing.T) {

out, _ = dockerCmd(c, "port", ID, "80")

err = assertPortList(c, out, []string{"0.0.0.0:9876", "0.0.0.0:9999"})
err = assertPortList(c, out, []string{"0.0.0.0:9876", "[::]:9876", "0.0.0.0:9999", "[::]:9999"})
// Port list is not correct
assert.NilError(c, err)

Expand All @@ -78,8 +81,12 @@ func (s *DockerSuite) TestPortList(c *testing.T) {
err = assertPortList(c, out, []string{
"80/tcp -> 0.0.0.0:9876",
"80/tcp -> 0.0.0.0:9999",
"80/tcp -> [::]:9876",
"80/tcp -> [::]:9999",
"81/tcp -> 0.0.0.0:9877",
"81/tcp -> [::]:9877",
"82/tcp -> 0.0.0.0:9878",
"82/tcp -> [::]:9878",
})
// Port list is not correct
assert.NilError(c, err)
Expand All @@ -94,7 +101,10 @@ func (s *DockerSuite) TestPortList(c *testing.T) {

out, _ = dockerCmd(c, "port", IDs[i])

err = assertPortList(c, out, []string{fmt.Sprintf("80/tcp -> 0.0.0.0:%d", 9090+i)})
err = assertPortList(c, out, []string{
fmt.Sprintf("80/tcp -> 0.0.0.0:%d", 9090+i),
fmt.Sprintf("80/tcp -> [::]:%d", 9090+i),
})
// Port list is not correct
assert.NilError(c, err)
}
Expand Down Expand Up @@ -127,9 +137,13 @@ func (s *DockerSuite) TestPortList(c *testing.T) {

err = assertPortList(c, out, []string{
"80/tcp -> 0.0.0.0:9800",
"80/tcp -> [::]:9800",
"81/tcp -> 0.0.0.0:9801",
"81/tcp -> [::]:9801",
"82/tcp -> 0.0.0.0:9802",
"82/tcp -> [::]:9802",
"83/tcp -> 0.0.0.0:9803",
"83/tcp -> [::]:9803",
})
// Port list is not correct
assert.NilError(c, err)
Expand Down Expand Up @@ -305,7 +319,7 @@ func (s *DockerSuite) TestPortHostBinding(c *testing.T) {

out, _ = dockerCmd(c, "port", firstID, "80")

err := assertPortList(c, out, []string{"0.0.0.0:9876"})
err := assertPortList(c, out, []string{"0.0.0.0:9876", "[::]:9876"})
// Port list is not correct
assert.NilError(c, err)

Expand Down
2 changes: 1 addition & 1 deletion vendor.conf
Expand Up @@ -47,7 +47,7 @@ github.com/grpc-ecosystem/go-grpc-middleware 3c51f7f332123e8be5a157c0802a
# libnetwork

# When updating, also update LIBNETWORK_COMMIT in hack/dockerfile/install/proxy.installer accordingly
github.com/docker/libnetwork fa125a3512ee0f6187721c88582bf8c4378bd4d7
github.com/docker/libnetwork b3507428be5b458cb0e2b4086b13531fb0706e46
github.com/docker/go-events e31b211e4f1cd09aa76fe4ac244571fab96ae47f
github.com/armon/go-radix e39d623f12e8e41c7b5529e9a9dd67a1e2261f80
github.com/armon/go-metrics eb0af217e5e9747e41dd5303755356b62d28e3ec
Expand Down
25 changes: 16 additions & 9 deletions vendor/github.com/docker/libnetwork/drivers/bridge/port_mapping.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion vendor/github.com/docker/libnetwork/iptables/iptables.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3d77885

Please sign in to comment.