network: do not add prefix to RA if radv is not configured
Fixes #17017.
This commit is contained in:
parent
882f5f429e
commit
85b6a8110d
|
@ -158,7 +158,8 @@ static int dhcp6_pd_remove_old(Link *link, bool force) {
|
|||
if (k < 0)
|
||||
r = k;
|
||||
|
||||
(void) sd_radv_remove_prefix(link->radv, &route->dst.in6, 64);
|
||||
if (link->radv)
|
||||
(void) sd_radv_remove_prefix(link->radv, &route->dst.in6, 64);
|
||||
dhcp6_pd_free(hashmap_get(link->manager->dhcp6_prefixes, &route->dst.in6));
|
||||
}
|
||||
|
||||
|
@ -198,7 +199,8 @@ int dhcp6_pd_remove(Link *link) {
|
|||
if (k < 0)
|
||||
r = k;
|
||||
|
||||
(void) sd_radv_remove_prefix(link->radv, &route->dst.in6, 64);
|
||||
if (link->radv)
|
||||
(void) sd_radv_remove_prefix(link->radv, &route->dst.in6, 64);
|
||||
dhcp6_pd_free(hashmap_get(link->manager->dhcp6_prefixes, &route->dst.in6));
|
||||
}
|
||||
|
||||
|
|
|
@ -681,7 +681,9 @@ int radv_add_prefix(Link *link, const struct in6_addr *prefix, uint8_t prefix_le
|
|||
int r;
|
||||
|
||||
assert(link);
|
||||
assert(link->radv);
|
||||
|
||||
if (!link->radv)
|
||||
return 0;
|
||||
|
||||
r = sd_radv_prefix_new(&p);
|
||||
if (r < 0)
|
||||
|
|
Loading…
Reference in New Issue