network: make route_update() accept NULL
This also fixes a wrong argument for route_configure(). Fixes #8960.
This commit is contained in:
@@ -189,11 +189,13 @@ static int dhcp6_pd_prefix_distribute(Link *dhcp6_link, Iterator *i,
|
||||
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;
|
||||
|
||||
@@ -361,14 +361,12 @@ void route_update(Route *route,
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user