Don't warn that we can't form a temporary address when a router
authorflorian <florian@openbsd.org>
Sun, 21 Mar 2021 13:59:22 +0000 (13:59 +0000)
committerflorian <florian@openbsd.org>
Sun, 21 Mar 2021 13:59:22 +0000 (13:59 +0000)
deprecates a prefix by sending a pltime of 0, this is normal.
Continue warning when the pltime is smaller than 5 as this is almost
certainly a configuration error.
Found the hard way by & OK otto.

sbin/slaacd/engine.c

index 7b49b33..35eb760 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: engine.c,v 1.69 2021/03/20 17:07:49 florian Exp $     */
+/*     $OpenBSD: engine.c,v 1.70 2021/03/21 13:59:22 florian Exp $     */
 
 /*
  * Copyright (c) 2017 Florian Obser <florian@openbsd.org>
@@ -1932,14 +1932,15 @@ update_iface_ra_prefix(struct slaacd_iface *iface, struct radv *ra,
 
        /* privacy addresses do not depend on eui64 */
        if (!found_privacy && iface->autoconfprivacy) {
-               if (prefix->pltime < PRIV_REGEN_ADVANCE) {
+               if (prefix->pltime >= PRIV_REGEN_ADVANCE) {
+                       /* new privacy proposal */
+                       gen_address_proposal(iface, ra, prefix, 1);
+               } else if (prefix->pltime > 0) {
                        log_warnx("%s: pltime from %s is too small: %d < %d; "
                            "not generating privacy address", __func__,
                            sin6_to_str(&ra->from), prefix->pltime,
                            PRIV_REGEN_ADVANCE);
-               } else
-                       /* new privacy proposal */
-                       gen_address_proposal(iface, ra, prefix, 1);
+               }
        }
 }