changeset 4965:78a1e76b04bd draft

dhcpcd: Don't report DUID or IAID in anonymous. It just confuses things.
author Roy Marples <roy@marples.name>
date Wed, 15 Jan 2020 16:24:37 +0000
parents f148a1b8a6e5
children be0a1437525a
files src/dhcpcd.c
diffstat 1 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/dhcpcd.c	Wed Jan 15 19:18:54 2020 +0300
+++ b/src/dhcpcd.c	Wed Jan 15 16:24:37 2020 +0000
@@ -792,6 +792,8 @@
 	TAILQ_FOREACH(ifn, ifp->ctx->ifaces, next) {
 		if (ifn == ifp || !ifn->active)
 			continue;
+		if (ifn->options->options & DHCPCD_ANONYMOUS)
+			continue;
 		if (ia_type == 0 &&
 		    memcmp(ifn->options->iaid, iaid,
 		    sizeof(ifn->options->iaid)) == 0)
@@ -847,7 +849,14 @@
 		}
 	}
 
-	if (ifo->options & (DHCPCD_DUID | DHCPCD_IPV6)) {
+	if (ifo->options & (DHCPCD_DUID | DHCPCD_IPV6) &&
+	    !(ifo->options & DHCPCD_ANONYMOUS))
+	{
+#ifdef INET6
+		size_t i;
+		struct if_ia *ia;
+#endif
+
 		/* Report client DUID */
 		if (ifp->ctx->duid == NULL) {
 			if (duid_init(ifp) == 0)
@@ -857,13 +866,6 @@
 			    ifp->ctx->duid_len,
 			    buf, sizeof(buf)));
 		}
-	}
-
-	if (ifo->options & (DHCPCD_DUID | DHCPCD_IPV6)) {
-#ifdef INET6
-		size_t i;
-		struct if_ia *ia;
-#endif
 
 		/* Report IAIDs */
 		loginfox("%s: IAID %s", ifp->name,