1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-22 13:33:56 +03:00

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 26a63b8132 ('sd-dhcp6-client: Fix
sending prefix delegation request (#17136)'). The justification is
probably the same.

(cherry picked from commit 58da18251f)
This commit is contained in:
Thomas Haller 2022-02-03 18:55:18 +01:00 committed by Luca Boccassi
parent 3a125c762f
commit 74dfb51f70

View File

@ -857,7 +857,7 @@ static int client_send_message(sd_dhcp6_client *client, usec_t time_now) {
return r; 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); r = dhcp6_option_append_pd(&opt, &optlen, &client->lease->pd, NULL);
if (r < 0) if (r < 0)
return r; return r;