Implement RFC 6221 para 4.

If the link address in a relayed DHCPv6 message is zero, don't
use it for addresss selection.
This commit is contained in:
Simon Kelley
2025-07-22 22:09:49 +01:00
parent 3034746748
commit d976d94e3d

View File

@@ -245,6 +245,10 @@ static int dhcp6_maybe_relay(struct state *state, unsigned char *inbuff, size_t
struct in6_addr align;
/* the packet data is unaligned, copy to aligned storage */
memcpy(&align, inbuff + 2, IN6ADDRSZ);
/* RFC6221 para 4 */
if (!IN6_IS_ADDR_UNSPECIFIED(&align))
state->link_address = &align;
/* zero is_unicast since that is now known to refer to the
relayed packet, not the original sent by the client */