Long MAC address in reservation crashes KEA when using reservation-get*
When reservation is added by reservation-add
with too long MAC address, KEA is not able to retrieve this reservation using reservation-get*
commands.
Reservation is added to the database with long address.
To Reproduce
- Run Kea dhcpv4 with host_cmds hook
- Make a reservation using
reservation-add
command with too long MAC address. Example:
"reservation": {
"hw-address": "11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff",
"ip-address": "192.168.50.100",
"subnet-id": 1
}
- Server returns:
{
"result": 0,
"text": "Host added."
}
- You can check database contents, long MAC is added to the database.
- Try to get reservation by any of the
reservation-get*
commands. Example:
"arguments": {
"subnet-id": 1
},
"command": "reservation-get-all"
- Kea exits with exception like
HOOKS_CALLOUT_EXCEPTION exception thrown by callout on hook $reservation_get_all registered by library with index 1 (callout address 0x7f8675052580): address vector size exceeds MAX_HWADDR_LEN
Expected behavior
Kea should either not accept too long MAC address in the reservation-add
command or return the whole long MAC with reservation-get*
Links:
Bug discovered by @tomek here: stork#771 (comment 289578)
Systems test request: isc-private/qa-dhcp#326
Edited by Marcin Godzina