diff src/script.c @ 5577:4da45107d87a draft

script: Use rt_proto_add to ensure no duplicate interfaces on OpenBSD OpenBSD allows matching priorities, so we need to take the interfaces in the order given to ensure uniqueness.
author Roy Marples <roy@marples.name>
date Mon, 18 Jan 2021 11:31:05 +0000
parents 465cc5abc6d6
children
line wrap: on
line diff
--- a/src/script.c	Mon Dec 28 12:59:20 2020 +0000
+++ b/src/script.c	Mon Jan 18 11:31:05 2021 +0000
@@ -390,6 +390,7 @@
 	if (ifp->ctx->options & DHCPCD_DUMPLEASE)
 		goto dumplease;
 
+	ifp->ctx->rt_order = 0;
 	rb_tree_init(&ifaces, &rt_compare_proto_ops);
 	TAILQ_FOREACH(ifp2, ifp->ctx->ifaces, next) {
 		if (!ifp2->active)
@@ -397,7 +398,7 @@
 		rt = rt_new(UNCONST(ifp2));
 		if (rt == NULL)
 			goto eexit;
-		if (rb_tree_insert_node(&ifaces, rt) != rt)
+		if (rt_proto_add(&ifaces, rt) != rt)
 			goto eexit;
 	}
 	if (fprintf(fp, "interface_order=") == -1)