OpenBSD allows matching priorities, so we need to take the interfaces
in the order given to ensure uniqueness.
return rt;
rt_free(rt);
+ errno = EEXIST;
return NULL;
}
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)
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)