diff options
author | Florian Obser <florian@cvs.openbsd.org> | 2020-10-30 18:26:25 +0000 |
---|---|---|
committer | Florian Obser <florian@cvs.openbsd.org> | 2020-10-30 18:26:25 +0000 |
commit | 075310e92247dc581e74d6557f5eea9020e4b1f6 (patch) | |
tree | 874b1bd2c8ded7816800e9825ce29c3212cf240b /sbin/slaacd/engine.c | |
parent | 0721d1b83cafeec82a806822940c34f017127786 (diff) |
Pull check for duplicate address up to skip them early, we are not
going to renew them. Avoids redundant check for privacy addresses.
Diffstat (limited to 'sbin/slaacd/engine.c')
-rw-r--r-- | sbin/slaacd/engine.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sbin/slaacd/engine.c b/sbin/slaacd/engine.c index ec39d01f8c8..f675a6e226d 100644 --- a/sbin/slaacd/engine.c +++ b/sbin/slaacd/engine.c @@ -1,4 +1,4 @@ -/* $OpenBSD: engine.c,v 1.52 2020/10/30 18:25:54 florian Exp $ */ +/* $OpenBSD: engine.c,v 1.53 2020/10/30 18:26:24 florian Exp $ */ /* * Copyright (c) 2017 Florian Obser <florian@openbsd.org> @@ -1838,10 +1838,14 @@ update_iface_ra_prefix(struct slaacd_iface *iface, struct radv *ra, sizeof(addr_proposal->soiikey)) != 0) continue; + if (addr_proposal->state == PROPOSAL_DUPLICATED) { + duplicate_found = 1; + continue; + } + if (addr_proposal->privacy) { /* create new privacy address if old expires */ - if (addr_proposal->state != PROPOSAL_NEARLY_EXPIRED && - addr_proposal->state != PROPOSAL_DUPLICATED) + if (addr_proposal->state != PROPOSAL_NEARLY_EXPIRED) found_privacy = 1; if (!iface->autoconfprivacy) @@ -1855,11 +1859,6 @@ update_iface_ra_prefix(struct slaacd_iface *iface, struct radv *ra, continue; } - if (addr_proposal->state == PROPOSAL_DUPLICATED) { - duplicate_found = 1; - continue; - } - found = 1; remaining_lifetime = real_lifetime(&addr_proposal->uptime, |