}
static int
- inet6_raroutes(rb_tree_t *routes, struct dhcpcd_ctx *ctx, int expired,
- bool *have_default)
-inet6_raroutes(struct rt_head *routes, struct dhcpcd_ctx *ctx)
++inet6_raroutes(rb_tree_t *routes, struct dhcpcd_ctx *ctx)
{
struct rt *rt;
struct ra *rap;
rt = inet6_makeprefix(rap->iface, rap, addr);
if (rt) {
rt->rt_dflags |= RTDF_RA;
- TAILQ_INSERT_TAIL(routes, rt, rt_next);
+ rt_proto_add(routes, rt);
}
}
- if (rap->lifetime) {
- rt = inet6_makerouter(rap);
- if (rt) {
- rt->rt_dflags |= RTDF_RA;
- if (rt_proto_add(routes, rt) && have_default)
- *have_default = true;
- }
- }
+ if (rap->lifetime == 0)
+ continue;
+ rt = inet6_makerouter(rap);
+ if (rt == NULL)
+ continue;
+ rt->rt_dflags |= RTDF_RA;
- TAILQ_INSERT_TAIL(routes, rt, rt_next);
++ rt_proto_add(routes, rt);
}
return 0;
}
#endif
bool
-inet6_getroutes(struct dhcpcd_ctx *ctx, struct rt_head *routes)
+inet6_getroutes(struct dhcpcd_ctx *ctx, rb_tree_t *routes)
{
- bool have_default;
/* Should static take priority? */
if (inet6_staticroutes(routes, ctx) == -1)