From: florian Date: Sun, 9 Jul 2017 08:41:47 +0000 (+0000) Subject: If we lower the pltime for privacy addresses skew it by X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=775c5c53da25cfe45bea7f79ce4e7dafc3bdedd6;p=openbsd 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. --- 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 @@ -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 {