Skip to content

Commit 9b29c69

Browse files
strssndktndavem330
authored andcommitted
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: 622c81d ("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>
1 parent 130ed5d commit 9b29c69

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎net/ipv6/addrconf.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,12 @@ static struct inet6_dev *ipv6_add_dev(struct net_device *dev)
350350
setup_timer(&ndev->rs_timer, addrconf_rs_timer,
351351
(unsigned long)ndev);
352352
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+
353359
ndev->cnf.mtu6 = dev->mtu;
354360
ndev->cnf.sysctl = NULL;
355361
ndev->nd_parms = neigh_parms_alloc(dev, &nd_tbl);

0 commit comments

Comments
 (0)