summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2017-07-09 08:41:48 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2017-07-09 08:41:48 +0000
commit24b12e3d1d1bc85decbfec91d4ab5f8b6e3a4014 (patch)
tree7c30b5eddbb2ddb76418ba2f9b03d5984b1c23cf /sbin
parent63c2d8a858f1e94494a12539bc00fcf61a48d88e (diff)
If we lower the pltime for privacy addresses skew it by
ND6_PRIV_MAX_DESYNC_FACTOR like RFC 4941 tells us to. Toss in a arc4random_uniform for good measure like the kernel always did.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/slaacd/engine.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sbin/slaacd/engine.c b/sbin/slaacd/engine.c
index d71b36a3ae8..6640240b870 100644
--- a/sbin/slaacd/engine.c
+++ b/sbin/slaacd/engine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: engine.c,v 1.4 2017/07/06 15:02:53 florian Exp $ */
+/* $OpenBSD: engine.c,v 1.5 2017/07/09 08:41:47 florian Exp $ */
/*
* Copyright (c) 2017 Florian Obser <florian@openbsd.org>
@@ -1708,7 +1708,8 @@ gen_address_proposal(struct slaacd_iface *iface, struct radv *ra, struct
addr_proposal->vltime = prefix->vltime;
if (prefix->pltime > ND6_PRIV_PREFERRED_LIFETIME)
- addr_proposal->pltime = ND6_PRIV_PREFERRED_LIFETIME;
+ addr_proposal->pltime = ND6_PRIV_PREFERRED_LIFETIME
+ - arc4random_uniform(ND6_PRIV_MAX_DESYNC_FACTOR);
else
addr_proposal->pltime = prefix->pltime;
} else {