dhcpv6: fix wrong retransmission of DHCPv6 Solicit
authorNicolas BESNARD <[email protected]>
Tue, 14 May 2024 14:19:15 +0000 (16:19 +0200)
committerÁlvaro Fernández Rojas <[email protected]>
Mon, 3 Nov 2025 15:14:43 +0000 (16:14 +0100)
commit96017df54d8fd6ec1dbf877e4c62921f951a3bc4
treef89d026ebed8b49259e4f6a624128cee9f645503
parentb929fc8a1cfdb003a0c7094e34d74ba6ef914b08
dhcpv6: fix wrong retransmission of DHCPv6 Solicit

When the DHCPv6 client sends a DHCPv6 Solicit with both IA_NA and IA_PD
options, and if the server replies with a status code = NoAddrsAvailable
in the IA_NA option, then currently the DHCPv6 client sends a new
Solicit with only the IA_PD option despite the fact that a prefix was
sent by the server in the previous Advertise.

This behavior is described in
https://datatracker.ietf.org/doc/html/rfc7550#section-4.2

The client must handle the case of a server that does not offer both
valid IA_NA and IA_PD options when both are requested, according to
RFC 7550. It should not send a new Solicit, but a Request. The client
should, however, ignore the Advertise message if none of the IA_NA and
IA_PD options are offered by the server.

Signed-off-by: Nicolas BESNARD <[email protected]>
Signed-off-by: Paul Donald <[email protected]>
Link: https://github.com/openwrt/odhcp6c/pull/106
Signed-off-by: Álvaro Fernández Rojas <[email protected]>
src/dhcpv6.c