Kea4 not honouring the "-p" switch
The kea-dhcp4/6 command switches -p and -P set the server and client ports respectively, allowing unprivileged ports to be used for debugging purposes.
When debugging a version of Kea-dhcp4 recently built from a branch derived from ac2e8032 (dated June 13, 2019) using "-p 9001 -P 9002", the following message was seen in the log file:
2019-06-18 14:18:03.699 DEBUG [kea-dhcp4.packets/30444] DHCP4_PACKET_SEND [hwtype=1 00:00:6c:82:dc:4e], cid=[01:00:00:6c:82:dc:4e], tid=0xac2effff: trying to send packet DHCPOFFER (type 2) from 10.53.0.1:67 to 255.255.255.255:9002 on interface lo
2019-06-18 14:18:03.700 DEBUG [kea-dhcp4.packets/30444] DHCP4_RESPONSE_DATA [hwtype=1 00:00:6c:82:dc:4e], cid=[01:00:00:6c:82:dc:4e], tid=0xac2effff: responding with packet DHCPOFFER (type 2), packet details: local_address=10.53.0.1:67, remote_address=255.255.255.255:9002, msg_type=DHCPOFFER (2), transid=0xac2effff,
options:
type=001, len=004: 4278190080 (uint32)
type=051, len=004: 14400 (uint32)
type=053, len=001: 2 (uint8)
type=054, len=004: 10.53.0.1
type=059, len=004: 7200 (uint32)
type=061, len=007: 01:00:00:6c:82:dc:4e
2019-06-18 14:18:03.701 ERROR [kea-dhcp4.packets/30444] DHCP4_PACKET_SEND_FAIL [hwtype=1 00:00:6c:82:dc:4e], cid=[01:00:00:6c:82:dc:4e], tid=0xac2effff: failed to send DHCPv4 packet: pkt4 send failed: sendmsg() returned with an error: Permission denied
It looks as if the code is attempting to send from privileged port 67 instead of the port specified by the -p option.