ipv6: addrconf: fix generation of new temporary addresses
authorMarcus Huewe <suse-tux@gmx.de>
Wed, 24 May 2017 01:53:49 +0000 (21:53 -0400)
committerRaspbian kernel package updater <root@raspbian.org>
Sun, 23 Jul 2017 02:57:43 +0000 (02:57 +0000)
commit599bfbe85e7f34b1cfbd1c0b7132d426829d7710
tree2f27601dffc7f8cf61db73ab0c467e38937e8fcd
parentbf03af20cc0200ce39a00eafc645a0c50deadb70
ipv6: addrconf: fix generation of new temporary addresses

[ Upstream commit a11a7f71cac209c7c9cca66eb506e1ebb033a3b3 ]

Under some circumstances it is possible that no new temporary addresses
will be generated.

For instance, addrconf_prefix_rcv_add_addr() indirectly calls
ipv6_create_tempaddr(), which creates a tentative temporary address and
starts dad. Next, addrconf_prefix_rcv_add_addr() indirectly calls
addrconf_verify_rtnl(). Now, assume that the previously created temporary
address has the least preferred lifetime among all existing addresses and
is still tentative (that is, dad is still running). Hence, the next run of
addrconf_verify_rtnl() is performed when the preferred lifetime of the
temporary address ends. If dad succeeds before the next run, the temporary
address becomes deprecated during the next run, but no new temporary
address is generated.

In order to fix this, schedule the next addrconf_verify_rtnl() run slightly
before the temporary address becomes deprecated, if dad succeeded.

Signed-off-by: Marcus Huewe <suse-tux@gmx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv6/addrconf.c