At the moment I have a situation where I have a WDS STA bridged with ethernet. If the wifi link goes down because the AP has been reconfigured, because the bridge remains up no DHCP renewals are done. This is a problem if the AP wants to hand out different IPs. At least, I think this is what's happening!
Is there an easy way to make this work? i.e. to make it always try to renew the DHCP lease if the wireless connection has gone down and up?
Looking into the netifd code, I feel like I could probably just change bridge_member_cb such that it did a TOPO_CHANGE on LINK_UP, which will trigger DHCP renewals, but I'm worried this will cause some deeper problem.
The AP doesn’t give out dchp leases or renewals. It only connects clients with radiowaves and handle encryption for the wifi connections.
It is dnsmasq that handles dhcp leases. But once a client have a IP for a network it will have that IP address for the whole leasetime no matter if it is connected or not, after half the leasetime it will start asking for renewal.
In my experience, if you down/up physical ports (or the wifi connection) but other ports are enabled on the bridge, OpenWrt does not issue a lease renewal. I believe this is due to it not issuing a TOPO_CHANGE on LINK_UP, but only when devices are added or removed from the bridge.
Note that I'm talking about an OpenWrt client here.
I don't believe this is related to my issue. I'm talking about the behaviour of an OpenWrt DHCP client when some links (but not all links) drop on the bridge. What DHCP server is running is irrelevant, or indeed whether it's running on OpenWrt at all. i.e. imagine your laptop: if you physically pull out the network cable and reconnect it, it will usually try to renew (or re-request) the lease. However, in OpenWrt land, if the interfaces are bridged it will not do this. This means if I have an OpenWrt STA using WDS that's bridged with ethernet, and the ethernet port is connected, if the Wi-Fi link drops it won't do a DHCP lease renewal or a new request.