1 Solaris doesn't have an easy way to retrieve the MAC address of the client
2 that is soliciting the DHCPv6 IP address. This fix uses a simple way to
3 retrieve the client MAC address from the client's EUI64 link-local address.
5 diff --git a/src/dhcp6.c b/src/dhcp6.c
6 index 9901e1b..49a092b 100644
9 @@ -261,6 +261,23 @@ void dhcp6_packet(time_t now)
11 void get_client_mac(struct in6_addr *client, int iface, unsigned char *mac, unsigned int *maclenp, unsigned int *mactypep, time_t now)
13 +#ifdef HAVE_SOLARIS_NETWORK
14 +/* Solaris does not have an easy way to retrieve MAC address for a given IPv6 address from the kernel.
15 + For now the following workaround should work for OpenStack's needs. */
18 + *maclenp = ETHER_ADDR_LEN;
19 + *mactypep = ARPHRD_ETHER;
20 + /* Take the EUI64 based client's link-local address and convert it to client's MAC address.
21 + For example: from fe80::f816:3eff:fe5c:df43 link-local address we arrive at fa:16:3e:5c:df:43 */
22 + addr6 = client->s6_addr;
23 + mac[0] = addr6[8] ^ 0x2;
30 /* Receiving a packet from a host does not populate the neighbour
31 cache, so we send a neighbour discovery request if we can't
32 find the sender. Repeat a few times in case of packet loss. */
33 @@ -301,6 +318,7 @@ void get_client_mac(struct in6_addr *client, int iface, unsigned char *mac, unsi
36 *mactypep = ARPHRD_ETHER;
37 +#endif /* HAVE_SOLARIS_NETWORK */
40 static int complete_context6(struct in6_addr *local, int prefix,