From 25a72db05ea5e46c2ee4398aa2afbdbc53514f01 Mon Sep 17 00:00:00 2001 From: Matthias FRANCK Date: Wed, 28 Aug 2024 12:36:52 +0200 Subject: [PATCH] odhcp6c: 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. References: PCF-1390 Signed-off-by: Matthias FRANCK --- ...dhcp6c-dont-retry-if-noaddravail-with-iapd.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 package/network/ipv6/odhcp6c/patches/0003-odhcp6c-dont-retry-if-noaddravail-with-iapd.patch diff --git a/package/network/ipv6/odhcp6c/patches/0003-odhcp6c-dont-retry-if-noaddravail-with-iapd.patch b/package/network/ipv6/odhcp6c/patches/0003-odhcp6c-dont-retry-if-noaddravail-with-iapd.patch new file mode 100644 index 0000000000..c7d1b4cc7d --- /dev/null +++ b/package/network/ipv6/odhcp6c/patches/0003-odhcp6c-dont-retry-if-noaddravail-with-iapd.patch @@ -0,0 +1,13 @@ +diff --git a/src/dhcpv6.c b/src/dhcpv6.c +index ca5957e..0b603f0 100644 +--- a/src/dhcpv6.c ++++ b/src/dhcpv6.c +@@ -1664,7 +1664,7 @@ int dhcpv6_promote_server_cand(void) + if (!cand_len) + return -1; + +- if (cand->has_noaddravail && na_mode == IA_MODE_TRY) { ++ if (!cand->ia_pd_len && cand->has_noaddravail && na_mode == IA_MODE_TRY) { + na_mode = IA_MODE_NONE; + + dhcpv6_retx[DHCPV6_MSG_SOLICIT].max_timeo = cand->sol_max_rt;