FS#2607 - odhcpd: assigns IPv4 address outside of interface subnet if static lease from another subnet exists #7445
Labels
core packages
pull request/issue for core (in-tree) packages
flyspray
release/19.07
pull request/issue targeted (also) for OpenWrt 19.07 release
janhoffmann:
When a static IPv4 lease is set up for a MAC address, odhcpd assigns that address even if it is outside the configured subnet of the relevant interface.
This is a problem if one wants to set a static lease for a host that may connect to one of multiple interfaces. It is also not possible to set separate static leases for each interface, as only the last one is used.
Software versions of OpenWrt/LEDE release, packages, etc:
Trunk and 19.07.
18.06 is unaffected.
It looks like this was introduced with [[https://git.openwrt.org/?p=project/odhcpd.git;a=commit;h=ca8ba91c757b1559bc6391707547d54477c8315a]].
Steps to reproduce:
Steps based on fresh install of OpenWrt:
Replace odhcpd-ipv6only by odhcpd
Enable odhcpd for IPv4 and set static lease with IPv4 address outside the default lan subnet:
uci set dhcp.odhcp.maindhcp=1
uci set dhcp.lan.dhcpv4="server"
uci add dhcp host
uci set dhcp.@host[-1].mac="11:22:33:44:55:66"
uci set dhcp.@host[-1].ip="192.168.2.100"
uci commit dhcp
Expected result: IP address from 192.168.1.0/24 is assigned to host 11:22:33:44:55:66
Actual result: IP address 192.168.2.100 is assigned to host 11:22:33:44:55:66
The text was updated successfully, but these errors were encountered: