Skip to content

17.04 / 17.05: The disappearance of the link-local & loopback ipv6 addresses #33099

@euank

Description

@euank

Description

After upgrading to 17.04-ce or 17.05-ce, I no longer have a link-local ipv6 address by default (with ipv6 not enabled).

I think this might be an intentional change related to #20569, but I also think it's not entirely well thought out and is dangerously backwards incompatible.

Here's a simple example of something that no longer works:

func main() {
	conn, _ := net.Listen("tcp", ":8080")
	_, err := net.Dial("tcp", conn.Addr().String())
	if err != nil {
		fmt.Printf("did not expect error, but got: %v", err)
	}
}

The above program is available as euank/ipv6-repro:latest

The problem is that a program thinks ipv6 is available because it's enabled in my kernel, but docker has broken ipv6; it tries to listen on both (woo!), but unknowingly can't listen on ipv6 since docker tore it down when creating the netns. The program doesn't know that and will still happily think it's listening on both and .Addr() gives the ipv6 formatted address as a result.

Furthermore, if I just want a link local address (and don't want to allocate routable addresses), there's no way to configure the default bridge network to do so. Enabling ipv6 requires that I have a range of addresses to assign, but all I want is link-local addresses as we got by default before.

The workaround I've found is the following: docker run --sysctl net.ipv6.conf.all.disable_ipv6=0 euank/ipv6-repro:latest

Steps to reproduce the issue:

  1. docker run euank/ipv6-repro:latest

  2. docker run busybox ip addr

Describe the results you received:

  1. did not expect error, but got: dial tcp [::]:8080: connect: cannot assign requested address

  2. 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
           valid_lft forever preferred_lft forever
    128: eth0@if129: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue 
        link/ether 02:42:ac:11:00:02 brd ff:ff:ff:ff:ff:ff
        inet 172.17.0.2/16 scope global eth0
           valid_lft forever preferred_lft forever
    

Describe the results you expected:

  1. No error, as was true in previous versions of docker (1.12.x, 1.13, 17.03)

  2. 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue qlen 1
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
           valid_lft forever preferred_lft forever
        inet6 ::1/128 scope host 
           valid_lft forever preferred_lft forever
    128: eth0@if129: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue 
        link/ether 02:42:ac:11:00:02 brd ff:ff:ff:ff:ff:ff
        inet 172.17.0.2/16 scope global eth0
           valid_lft forever preferred_lft forever
        inet6 fe80::42:acff:fe11:2/64 scope link tentative 
           valid_lft forever preferred_lft forever
    

Additional information you deem important (e.g. issue happens only occasionally):

Output of docker version:

Client:
 Version:      17.05.0-ce
 API version:  1.29
 Go version:   go1.7.5
 Git commit:   89658be
 Built:        Thu May  4 22:14:18 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.05.0-ce
 API version:  1.29 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   89658be
 Built:        Thu May  4 22:14:18 2017
 OS/Arch:      linux/amd64
 Experimental: false

Default fedora installation with ipv6 enabled on the host, config_ipv6 in the kernel, all that jazz.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions