summaryrefslogtreecommitdiff
path: root/include/net6.h
diff options
context:
space:
mode:
authorSean Edmond <[email protected]>2025-03-24 13:48:45 -0700
committerJerome Forissier <[email protected]>2025-04-23 09:58:07 +0200
commit9a6964e419c0a533e1ca5d224221e440093a9e5f (patch)
treeba7daf2759a712cc7d247638f05cfd2340593f9f /include/net6.h
parent4446bc331c65d3efb8a9321d6368c61edb56479b (diff)
net: dhcp6: Send DHCPv6 using multicast MAC
In IPv6, the broadcast MAC address is not used. Instead, it should use the multicast address (see RFC RFC2464). Add IPV6_ALL_NODE_ETH_ADDR macro for clarity. Signed-off-by: Sean Edmond <[email protected]> Reviewed-by: Jerome Forissier <[email protected]>
Diffstat (limited to 'include/net6.h')
-rw-r--r--include/net6.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/net6.h b/include/net6.h
index 1ed989e584a..2ceeaba0639 100644
--- a/include/net6.h
+++ b/include/net6.h
@@ -90,6 +90,16 @@ struct udp_hdr {
0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x00, \
0x00, 0x00, 0x00, 0x02 } } }
+/*
+ * With IPv6, the broadcast MAC address is not used. Instead, it should use
+ * the multicast address (see RFC RFC2464 section 7)
+ */
+#define IPV6_ALL_NODE_ETH_ADDR(_ip6_addr) {0x33, \
+ 0x33, \
+ _ip6_addr.in6_u.u6_addr8[12], \
+ _ip6_addr.in6_u.u6_addr8[13], \
+ _ip6_addr.in6_u.u6_addr8[14], \
+ _ip6_addr.in6_u.u6_addr8[15]}
#define IPV6_LINK_LOCAL_PREFIX 0xfe80
#define IPV6_LINK_LOCAL_MASK 0xffb0 /* The first 10-bit of address mask. */