Commit ff22985
committed
dhcp-server: T9202: add client identifier to DHCPv4 lease output
kea_get_server_leases() copies the DHCPv6 DUID out of the lease Kea
returns but drops the DHCPv4 client identifier, so `show dhcp server
leases` cannot show it and neither can anything built on the op-mode
API. Kea itself has it: lease4-get-all returns 'client-id' alongside
'hw-address'.
This matters wherever a reservation is matched on the client identifier
rather than the MAC. Hosts using systemd-networkd send an RFC 4361
identifier -- ff:<IAID>:<DUID> -- instead of the traditional 01:<MAC>,
and Kea matches a static-mapping 'duid' against the DUID embedded in it.
Without the identifier in the lease output there is no way to read the
value a reservation has to be written with, and a static-mapping
carrying the wrong one is accepted, rendered into the Kea configuration,
and silently never matches: the host keeps taking a dynamic address
while every screen reports it as reserved.
Kea returns client-id already colon separated, so unlike the DHCPv6 DUID
it is not passed through _format_hex_string().
IP Address MAC address Hostname Client ID
192.168.10.60 00:e0:4c:68:4e:0d arya 01:00:e0:4c:68:4e:0d
192.168.10.40 52:54:00:32:6a:fa ppp-server ff:00:32:6a:fa:00:01:00:01:32:0d:2a:4c:52:54:00:32:6a:fa
192.168.10.92 52:54:00:e3:be:41 ember-u26 ff:b5:5e:67:ff:00:02:00:00:ab:11:68:46:79:5a:ab:74:cd:25
The column is appended rather than inserted next to the MAC, matching
where DHCPv6 already puts its DUID and leaving the existing column order
untouched. 'client_id' is also accepted as a sort key and offered in the
completion list for the inet variants of 'show dhcp server leases sort'.
Signed-off-by: allanice001 <allanice001@gmail.com>1 parent ba8924d commit ff22985
3 files changed
Lines changed: 28 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
| 151 | + | |
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
| 169 | + | |
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
| |||
256 | 256 | | |
257 | 257 | | |
258 | 258 | | |
259 | | - | |
| 259 | + | |
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
279 | | - | |
| 279 | + | |
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
| |||
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
290 | | - | |
| 290 | + | |
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
| |||
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
308 | | - | |
| 308 | + | |
309 | 309 | | |
310 | 310 | | |
311 | 311 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
683 | 683 | | |
684 | 684 | | |
685 | 685 | | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
686 | 691 | | |
687 | 692 | | |
688 | 693 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
54 | 55 | | |
55 | 56 | | |
56 | 57 | | |
| |||
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
| 115 | + | |
114 | 116 | | |
115 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
116 | 129 | | |
117 | 130 | | |
118 | 131 | | |
| |||
125 | 138 | | |
126 | 139 | | |
127 | 140 | | |
| 141 | + | |
128 | 142 | | |
129 | 143 | | |
130 | 144 | | |
| |||
0 commit comments