Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FS#2607 - odhcpd: assigns IPv4 address outside of interface subnet if static lease from another subnet exists #7445

Open
openwrt-bot opened this issue Nov 16, 2019 · 0 comments
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

Comments

@openwrt-bot
Copy link

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

@aparcar aparcar added release/19.07 pull request/issue targeted (also) for OpenWrt 19.07 release core packages pull request/issue for core (in-tree) packages labels Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants