To support RFC 7084, WPD-4.
switch (client->state) {
case DHCP6_STATE_INFORMATION_REQUEST:
+ /* RFC 7084 section 4.2 (https://datatracker.ietf.org/doc/html/rfc7084#section-4.2)
+ * WPD-4: By default, the IPv6 CE router MUST initiate DHCPv6 prefix delegation when either
+ * the M or O flags are set to 1 in a received Router Advertisement (RA) message. */
+ if (FLAGS_SET(client->request_ia, DHCP6_REQUEST_IA_PD)) {
+ r = dhcp6_option_append_ia(&buf, &offset, (client->lease ? client->lease->ia_pd : NULL) ?: &client->ia_pd);
+ if (r < 0)
+ return r;
+ }
break;
case DHCP6_STATE_SOLICITATION:
case SD_DHCP6_OPTION_IA_PD: {
_cleanup_(dhcp6_ia_freep) DHCP6IA *ia = NULL;
- if (client->state == DHCP6_STATE_INFORMATION_REQUEST) {
- log_dhcp6_client(client, "Ignoring IA PD option in information requesting mode.");
- break;
- }
-
r = dhcp6_option_parse_ia(client, client->ia_pd.header.id, optcode, optlen, optval, &ia);
if (r == -ENOMEM)
return log_oom_debug();
DHCP6_MESSAGE_INFORMATION_REQUEST,
/* Transaction ID */
0x0f, 0xb4, 0xe5,
+ /* IA_PD */
+ 0x00, SD_DHCP6_OPTION_IA_PD, 0x00, 0x0c,
+ IA_ID_BYTES,
+ 0x00, 0x00, 0x00, 0x00, /* lifetime T1 */
+ 0x00, 0x00, 0x00, 0x00, /* lifetime T2 */
/* MUD URL */
/* ORO */
0x00, SD_DHCP6_OPTION_ORO, 0x00, 0x0c,