Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ipv6: automatically enable stable privacy mode if stable_secret set

Bjørn reported that while we switch all interfaces to privacy stable mode
when setting the secret, we don't set this mode for new interfaces. This
does not make sense, so change this behaviour.

Fixes: 622c81d57b392cc ("ipv6: generation of stable privacy addresses for link-local and autoconf")
Reported-by: Bjørn Mork <bjorn@mork.no>
Cc: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Hannes Frederic Sowa and committed by
David S. Miller
9b29c696 130ed5d1

+6
+6
net/ipv6/addrconf.c
··· 350 350 setup_timer(&ndev->rs_timer, addrconf_rs_timer, 351 351 (unsigned long)ndev); 352 352 memcpy(&ndev->cnf, dev_net(dev)->ipv6.devconf_dflt, sizeof(ndev->cnf)); 353 + 354 + if (ndev->cnf.stable_secret.initialized) 355 + ndev->addr_gen_mode = IN6_ADDR_GEN_MODE_STABLE_PRIVACY; 356 + else 357 + ndev->addr_gen_mode = IN6_ADDR_GEN_MODE_EUI64; 358 + 353 359 ndev->cnf.mtu6 = dev->mtu; 354 360 ndev->cnf.sysctl = NULL; 355 361 ndev->nd_parms = neigh_parms_alloc(dev, &nd_tbl);