Opened 4 years ago

Closed 4 years ago

#4217 closed defect (fixed)

kea-dhcp4 drops ALL packets which contain a client id if MySQL host storage is enabled

Reported by: tmark Owned by: tomek
Priority: high Milestone: Kea1.0-beta
Component: dhcp4 Version: git
Keywords: Cc:
CVSS Scoring: Parent Tickets:
Sensitive: no Defect Severity: N/A
Sub-Project: DHCP Feature Depending on Ticket:
Estimated Difficulty: 0 Add Hours to Ticket: 0
Total Hours: 0 Internal?: no


If kea-dhcp4 is configured to use MySQL host storage, any query receive which contains client id gets dropped:

2015-12-02 15:46:41.765 DEBUG [kea-dhcp4.hosts/12247] HOSTS_CFG_GET_ONE_SUBNET_ID_HWADDR_DUID_NULL host not found using subnet id 1, HW address hwtype=1 08:00:27:99:72:be and DUID 30:30:30:30:31
2015-12-02 15:46:41.765 DEBUG [kea-dhcp4.hosts/12247] HOSTS_MGR_ALTERNATE_GET4_SUBNET_ID_HWADDR_DUID trying alternate source for host using subnet id 1, HWADDR hwtype=1 08:00:27:99:72:be, DUID30:30:30:30:31
2015-12-02 15:46:41.765 DEBUG [kea-dhcp4.bad-packets/12247] DHCP4_PACKET_DROP_0007 [hwtype=1 08:00:27:99:72:be], cid=[30:30:30:30:31], tid=0xf342de: failed to process packet: MySQL host data source get4() called with both hwaddr and duid, only one of them is allowed

Apparently MySqlHostDataSource::get4() cannot be called with both client Id and hwaddr non-null. The exception propagates up and causes the server to toss the packet.

ISC DHCP looks for client id, then hwaddr, thus giving preferenc to client id.


Change History (6)

comment:1 Changed 4 years ago by tomek

  • Status changed from new to reviewing

Proposed fix is implemented. I tried to keep it minimal, so it's easier to cherry-pick.

comment:2 Changed 4 years ago by tomek

  • Milestone changed from Kea-proposed to Kea1.0

comment:3 Changed 4 years ago by tomek

  • Milestone changed from Kea1.0 to Kea1.0-beta

comment:4 Changed 4 years ago by tmark

  • Owner set to tmark

comment:5 Changed 4 years ago by tmark

  • Owner changed from tmark to tomek

One question to look at is whether we do or should document the order perference in the admin guide. Other than that the changes look good. Please merge.

comment:6 Changed 4 years ago by tomek

  • Resolution set to fixed
  • Status changed from reviewing to closed

This fix is now merged to master and will be included in 1.0.0beta.

Note: See TracTickets for help on using tickets.