This also fixes a wrong argument for route_configure().
Fixes #8960.
if (r < 0)
return r;
+ route->family = AF_INET6;
+
while (n < n_prefixes) {
route_update(route, &prefix, pd_prefix_len, NULL, NULL,
0, 0, RTN_UNREACHABLE);
- r = route_configure(route, link, NULL);
+ r = route_configure(route, dhcp6_link, NULL);
if (r < 0) {
route_free(route);
return r;
unsigned char type) {
assert(route);
- assert(src);
- assert(gw);
- assert(prefsrc);
+ assert(src || src_prefixlen == 0);
- route->src = *src;
+ route->src = src ? *src : (union in_addr_union) {};
route->src_prefixlen = src_prefixlen;
- route->gw = *gw;
- route->prefsrc = *prefsrc;
+ route->gw = gw ? *gw : (union in_addr_union) {};
+ route->prefsrc = prefsrc ? *prefsrc : (union in_addr_union) {};
route->scope = scope;
route->protocol = protocol;
route->type = type;