]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
ipv6: dad: don't remove dynamic addresses if link is down
authorSabrina Dubroca <sd@queasysnail.net>
Thu, 29 Jun 2017 14:56:54 +0000 (16:56 +0200)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Fri, 11 Aug 2017 10:37:01 +0000 (12:37 +0200)
commitd82b34ebd74550d857a8dd7a0fb228702f6422fc
tree79c7524085dac181ac06afd84cc280565ca617e2
parent21d03da851fb54d46c16a68ad6ab859cd84ecbb9
ipv6: dad: don't remove dynamic addresses if link is down

BugLink: http://bugs.launchpad.net/bugs/1705707
commit ec8add2a4c9df723c94a863b8fcd6d93c472deed upstream.

Currently, when the link for $DEV is down, this command succeeds but the
address is removed immediately by DAD (1):

    ip addr add 1111::12/64 dev $DEV valid_lft 3600 preferred_lft 1800

In the same situation, this will succeed and not remove the address (2):

    ip addr add 1111::12/64 dev $DEV
    ip addr change 1111::12/64 dev $DEV valid_lft 3600 preferred_lft 1800

The comment in addrconf_dad_begin() when !IF_READY makes it look like
this is the intended behavior, but doesn't explain why:

     * If the device is not ready:
     * - keep it tentative if it is a permanent address.
     * - otherwise, kill it.

We clearly cannot prevent userspace from doing (2), but we can make (1)
work consistently with (2).

addrconf_dad_stop() is only called in two cases: if DAD failed, or to
skip DAD when the link is down. In that second case, the fix is to avoid
deleting the address, like we already do for permanent addresses.

Fixes: 3c21edbd1137 ("[IPV6]: Defer IPv6 device initialization until the link becomes ready.")
Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
net/ipv6/addrconf.c