1 From f8c77edbdffb8ada7753ea9fa104f0f6da70cfe3 Mon Sep 17 00:00:00 2001
2 From: Simon Kelley <simon@thekelleys.org.uk>
3 Date: Thu, 10 Jan 2019 21:58:18 +0000
4 Subject: [PATCH 29/32] Fix removal of DHCP_CLIENT_MAC options from DHCPv6
7 Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
9 src/rfc3315.c | 30 +++++++++++++++++-------------
10 1 file changed, 17 insertions(+), 13 deletions(-)
14 @@ -219,21 +219,25 @@ static int dhcp6_maybe_relay(struct stat
15 if (opt6_ptr(opt, 0) + opt6_len(opt) > end)
18 - int o = new_opt6(opt6_type(opt));
19 - if (opt6_type(opt) == OPTION6_RELAY_MSG)
20 + /* Don't copy MAC address into reply. */
21 + if (opt6_type(opt) != OPTION6_CLIENT_MAC)
23 - struct in6_addr align;
24 - /* the packet data is unaligned, copy to aligned storage */
25 - memcpy(&align, inbuff + 2, IN6ADDRSZ);
26 - state->link_address = &align;
27 - /* zero is_unicast since that is now known to refer to the
28 - relayed packet, not the original sent by the client */
29 - if (!dhcp6_maybe_relay(state, opt6_ptr(opt, 0), opt6_len(opt), client_addr, 0, now))
31 + int o = new_opt6(opt6_type(opt));
32 + if (opt6_type(opt) == OPTION6_RELAY_MSG)
34 + struct in6_addr align;
35 + /* the packet data is unaligned, copy to aligned storage */
36 + memcpy(&align, inbuff + 2, IN6ADDRSZ);
37 + state->link_address = &align;
38 + /* zero is_unicast since that is now known to refer to the
39 + relayed packet, not the original sent by the client */
40 + if (!dhcp6_maybe_relay(state, opt6_ptr(opt, 0), opt6_len(opt), client_addr, 0, now))
44 + put_opt6(opt6_ptr(opt, 0), opt6_len(opt));
47 - else if (opt6_type(opt) != OPTION6_CLIENT_MAC)
48 - put_opt6(opt6_ptr(opt, 0), opt6_len(opt));