Comment 6 for bug 1629972

Revision history for this message
Scott Moser (smoser) wrote :

It seems that the issue here is networking.service does:
  /sbin/ifdown -a --read-environment
but it should do:
  ifdown -a --exclude=lo

As is seen in the equivalent upstart job (/etc/init/networking.conf).

$ m="ifdown -a --read-environment";
$ sed -i "s,$m, --exclude=lo," /lib/systemd/system/networking.service
$ systemctl daemon-reload
$ sudo poweroff

Demonstration below.

## http://paste.ubuntu.com/23319833/
## ipv6 networking is broken by
## ip link set down dev lo
##
## This seems to be the root cause of bug 1629972 (http://pad.lv/1629972)
## where system networking (networking.service) is brought down on
## shutdown and causes hang.
##
## Note, that it is the link that is the issue, there is actually
## no problem seen in 'ping6' by either:
## ip addr del 127.0.0.1/8 dev lo
## ip addr del ::1/128 dev lo

$ for n in y1 y2; do lxc delete --force $n; lxc launch ubuntu-daily:yakkety $n; done
error: not found
Creating y1
Starting y1
error: not found
Creating y2
Starting y2

$ for n in y1 y2; do lxc exec $n -- dhclient -6 -1 -v eth0; done

$ lxc list y[12]
+------+---------+----------------------+------------------------------------------------+------------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+------+---------+----------------------+------------------------------------------------+------------+-----------+
| y1 | RUNNING | 10.75.205.102 (eth0) | fd42:eee5:7c43:3d62:c7fd:6ccc:6181:8d48 (eth0) | PERSISTENT | 0 |
+------+---------+----------------------+------------------------------------------------+------------+-----------+
| y2 | RUNNING | 10.75.205.5 (eth0) | fd42:eee5:7c43:3d62:f285:69dd:7210:c0a5 (eth0) | PERSISTENT | 0 |
+------+---------+----------------------+------------------------------------------------+------------+-----------+

$ for n in y1 y2; do
   lxc exec $n -- ip route add fd42:eee5:7c43:3d62::0/64 dev eth0

$ lxc exec y1 -- ping6 fd42:eee5:7c43:3d62:f285:69dd:7210:c0a5
PING fd42:eee5:7c43:3d62:f285:69dd:7210:c0a5(fd42:eee5:7c43:3d62:f285:69dd:7210:c0a5) 56 data bytes
64 bytes from fd42:eee5:7c43:3d62:f285:69dd:7210:c0a5: icmp_seq=1 ttl=64 time=0.133 ms
64 bytes from fd42:eee5:7c43:3d62:f285:69dd:7210:c0a5: icmp_seq=2 ttl=64 time=0.061 ms
64 bytes from fd42:eee5:7c43:3d62:f285:69dd:7210:c0a5: icmp_seq=3 ttl=64 time=0.069 ms
...

<window 2>
$ lxc exec y1 -- ip link set down dev lo

immediately ping6 starts dropping packets in window1.