]> git.ipfire.org Git - thirdparty/openwrt.git/commit
scripts: dhcp/dhcpv6: handling of invalid client ID values 23662/head
authorShine <4c.fce2@proton.me>
Sun, 31 May 2026 13:16:09 +0000 (15:16 +0200)
committerRobert Marko <robimarko@gmail.com>
Thu, 11 Jun 2026 08:40:57 +0000 (10:40 +0200)
commit9ba54d2d9ec1c8bffa84203c7c350914d7185912
tree60de139aed799799a43e08bf7aadcb5425398f37
parentcbd8fe4461c144ff17a043f059a5ce4f49ef118e
scripts: dhcp/dhcpv6: handling of invalid client ID values

Verify and clean up client ID and global DUID config values before use, in
order to prevent DHCP client malfunction and loss of IPv4 and/or IPv6
connectivity.

- Accept common separators in the string (colon, dash, spaces/tabs, lf)
- Ignore invalid values (non-hex or odd-numbered length)
- Log a warning for invalid settings

The fall back mechanism is as follows:

If a (user-configured) network.<ifname>.clientid setting is found invalid,
ignore and fall back to using network.globals.dhcp_default_duid. In case
that's also invalid (e.g. has been tampered with), don't pass a client
ID to updhc/odhcpc. In that case, udhcpc/odhcpc will use their defaults,
which currently is the i/f MAC address resp. the i/f DUID-LL.

Only error handling is introduced, no behavior change for valid settings.

Signed-off-by: Shine <4c.fce2@proton.me>
Link: https://github.com/openwrt/openwrt/pull/23662
Signed-off-by: Robert Marko <robimarko@gmail.com>
package/base-files/files/lib/functions.sh
package/network/config/netifd/files/lib/netifd/proto/dhcp.sh
package/network/ipv6/odhcp6c/files/dhcpv6.sh