]> git.ipfire.org Git - thirdparty/systemd.git/commit
networkd: fallback to chaddr for static lease lookup when not found
authorRobert Meijers <systemd@robert.meijers.dev>
Mon, 17 Apr 2023 20:16:05 +0000 (22:16 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 20 Apr 2023 10:18:50 +0000 (19:18 +0900)
commit4646cdaa378fa2aab7334a80228d8a94b316763b
tree11cb85089d02f9a7505be73f715cba056b77d688
parent114e85d28e9543e39d25414475c3f7e70a6fcbbb
networkd: fallback to chaddr for static lease lookup when not found

DHCP static leases are looked up by the client identifier as send by
the client, while configured based on MAC. As RFC 2131 states the client
identifier is an opaque key and must not be interpreted by the server
this means that DHCP clients can (/will) also use a client identifier
which is not a MAC address. One of these clients actually is
systemd-networkd which uses an RFC 4361 by default to generate the
client identifier. For these kind of DHCP clients static leases thus
don't work because of this mismatch between configuring a MAC address
but the server matching based on client identifier. This adds a fallback
to try to look up a configured static lease based on the "chaddr" of the
DHCP message as this will always contain the MAC address of the client.

Fixes #21368
src/libsystemd-network/sd-dhcp-server.c