From: Yu Watanabe Date: Fri, 11 Sep 2020 09:39:16 +0000 (+0900) Subject: network: do not add prefix to RA if radv is not configured X-Git-Tag: v247-rc1~251 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=85b6a8110d21defb3d6cddace09ee21db4eb9766;p=thirdparty%2Fsystemd.git network: do not add prefix to RA if radv is not configured Fixes #17017. --- diff --git a/src/network/networkd-dhcp6.c b/src/network/networkd-dhcp6.c index 05fe679fcfe..7996e825c29 100644 --- a/src/network/networkd-dhcp6.c +++ b/src/network/networkd-dhcp6.c @@ -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)); } diff --git a/src/network/networkd-radv.c b/src/network/networkd-radv.c index e0c490babab..003a50b68b0 100644 --- a/src/network/networkd-radv.c +++ b/src/network/networkd-radv.c @@ -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)