# HG changeset patch # User Roy Marples # Date 1610969465 0 # Node ID 4da45107d87a3c6646f9937a6eba380e6a0f3f4d # Parent 34d5feec82745290c90d5c4aa5a0354c69ce4399 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. diff -r 34d5feec8274 -r 4da45107d87a src/route.c --- a/src/route.c Mon Dec 28 12:59:20 2020 +0000 +++ b/src/route.c Mon Jan 18 11:31:05 2021 +0000 @@ -409,6 +409,7 @@ return rt; rt_free(rt); + errno = EEXIST; return NULL; } diff -r 34d5feec8274 -r 4da45107d87a src/script.c --- 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)