From: Thomas Haller Date: Thu, 3 Feb 2022 17:55:18 +0000 (+0100) Subject: sd-dhcp6-client: fix sending prefix delegation request during rebind X-Git-Tag: v251-rc1~346 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=58da18251f468de9de4cc7b36804c924e2fd4421;p=thirdparty%2Fsystemd.git sd-dhcp6-client: fix sending prefix delegation request during rebind 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. --- diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c index 706904c7202..84bc739bba2 100644 --- a/src/libsystemd-network/sd-dhcp6-client.c +++ b/src/libsystemd-network/sd-dhcp6-client.c @@ -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;