From ea5b0e64e2238db0632e7c985ef8413c0a91e889 Mon Sep 17 00:00:00 2001 From: Simon Kelley Date: Tue, 22 Jul 2025 23:05:54 +0100 Subject: [PATCH] Make DHCP6ADVERTISE messages RFC 8415 compliant. Include IA_* options even if no addresses are allocated, and always return options specified in ORO. --- src/rfc3315.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/rfc3315.c b/src/rfc3315.c index fa7448f..e1f6189 100644 --- a/src/rfc3315.c +++ b/src/rfc3315.c @@ -774,15 +774,6 @@ static int dhcp6_no_relay(struct state *state, int msg_type, unsigned char *inbu if (address_assigned != 1) { - /* If the server will not assign any addresses to any IAs in a - subsequent Request from the client, the server MUST send an Advertise - message to the client that doesn't include any IA options. */ - if (!state->lease_allocate) - { - save_counter(o); - continue; - } - /* If the server cannot assign any addresses to an IA in the message from the client, the server MUST include the IA in the Reply message with no addresses in the IA and a Status Code option in the IA @@ -809,7 +800,6 @@ static int dhcp6_no_relay(struct state *state, int msg_type, unsigned char *inbu o = new_opt6(OPTION6_PREFERENCE); put_opt6_char(option_bool(OPT_AUTHORITATIVE) ? 255 : 0); end_opt6(o); - tagif = add_options(state, 0); } else { @@ -829,7 +819,8 @@ static int dhcp6_no_relay(struct state *state, int msg_type, unsigned char *inbu break; } } - + + tagif = add_options(state, 0); break; }