Closed schenot closed 4 years ago
Hmm, strange, I would have said it works the other way around:
getHWAddr()
just returns an attribute: https://jenkins.isc.org/job/Kea_doc/doxygen/dd/d08/pkt4_8h_source.html#l00326getMAC()
does much more work and is able to look at options inserted by relays: https://jenkins.isc.org/job/Kea_doc/doxygen/d7/d84/pkt_8cc_source.html#l00146 (although looking at it again, it's obvious that it starts with the MAC address of raw socket)But since I haven't actually tested it with a relay and you have, I'm going to trust you and merge this!
Merged and released as 1.3.2, thanks!
The getMAC method of pkt4 seems to retrieve the mac of the packet sender which is not the client MAC if a dhcp-relay is used.
The getHWAddr seems to be the method used in the KEA server (it's used in src/bin/dhcp4/dhcp4_srv.cc of the KEA 1.6.1 sources) and return the expected MAC address.
I test this patch with KEA 1.6.1 sources and hook release v1.3.1, it work as expected. Without this path the MAC address in KEA_QUERY4_HWADDR is the MAC address of my default gateway, because the packet is forwarded from a dhcp-relay.