]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-dhcp6-client: fix sending prefix delegation request during rebind
authorThomas Haller <thaller@redhat.com>
Thu, 3 Feb 2022 17:55:18 +0000 (18:55 +0100)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 5 Feb 2022 05:11:33 +0000 (14:11 +0900)
Fixes an assertion failure "pd->type == SD_DHCP6_OPTION_IA_PD" in dhcp6_option_append_pd().

Something similar was done in commit 26a63b81322a ('sd-dhcp6-client: Fix
sending prefix delegation request (#17136)'). The justification is
probably the same.

src/libsystemd-network/sd-dhcp6-client.c

index 706904c7202cefe4dcd9a6d05eda695fa90d2102..84bc739bba27ca46d5574078f92798d3622d8fcf 100644 (file)
@@ -857,7 +857,7 @@ static int client_send_message(sd_dhcp6_client *client, usec_t time_now) {
                                 return r;
                 }
 
-                if (FLAGS_SET(client->request_ia, DHCP6_REQUEST_IA_PD)) {
+                if (FLAGS_SET(client->request_ia, DHCP6_REQUEST_IA_PD) && client->lease->pd.addresses) {
                         r = dhcp6_option_append_pd(&opt, &optlen, &client->lease->pd, NULL);
                         if (r < 0)
                                 return r;