From: Roy Marples Date: Fri, 14 Jun 2019 14:22:43 +0000 (+0100) Subject: Merge branch 'master' into rbtree X-Git-Tag: v8.0.0~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f035b1709ed0b6c37db02a6c7e015e98c1931e0;p=thirdparty%2Fdhcpcd.git Merge branch 'master' into rbtree --- 1f035b1709ed0b6c37db02a6c7e015e98c1931e0 diff --cc src/ipv6.c index f9ff1422,e9e6dc25..8288cb40 --- a/src/ipv6.c +++ b/src/ipv6.c @@@ -2235,8 -2240,7 +2235,7 @@@ inet6_staticroutes(rb_tree_t *routes, s } 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; @@@ -2251,17 -2255,16 +2250,16 @@@ 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; } @@@ -2293,9 -2296,8 +2291,8 @@@ inet6_dhcproutes(rb_tree_t *routes, str #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)