diff options
author | Valentyn Datsko <valikk.d@gmail.com> | 2022-04-06 16:13:13 +0300 |
---|---|---|
committer | Daniel Golle <daniel@makrotopia.org> | 2022-04-06 17:32:42 +0100 |
commit | 76f55e3c3f32dea63a385e9b3c8eaed1322089c7 (patch) | |
tree | 58524d9e40fa2ab4ab1b8697a182ac99f4934251 | |
parent | 64f629e2078b0c76bfe176a6f2f56877391b1b4e (diff) | |
download | upstream-76f55e3c3f32dea63a385e9b3c8eaed1322089c7.tar.gz upstream-76f55e3c3f32dea63a385e9b3c8eaed1322089c7.tar.bz2 upstream-76f55e3c3f32dea63a385e9b3c8eaed1322089c7.zip |
dnsmasq: add procd interface index tracking
Problem exist when dnsmasq is exclusively bind to particular interface.
After reconfiguring or restarting this interface, its index changes, but
dnsmasq uses the old one. When this problem occurs, dnsmasq does not
listen on the correct interface so DHCP does not work, and clients do not
get an IP address. Procd netdev param can be added to restart dnsmasq when
the interface index is changed.
Signed-off-by: Valentyn Datsko <valikk.d@gmail.com>
[combined into a single &&-connected statement]
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
-rwxr-xr-x | package/network/services/dnsmasq/files/dnsmasq.init | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 09dce0a78d..d95502c0da 100755 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -1156,6 +1156,11 @@ dnsmasq_start() [ -n "$user_dhcpscript" ] && procd_set_param env USER_DHCPSCRIPT="$user_dhcpscript" procd_set_param respawn + local instance_ifc instance_netdev + config_get instance_ifc "$cfg" interface + [ -n "$instance_ifc" ] && network_get_device instance_netdev "$instance_ifc" && + [ -n "$instance_netdev" ] && procd_set_param netdev $instance_netdev + procd_add_jail dnsmasq ubus log procd_add_jail_mount $CONFIGFILE $DHCPBOGUSHOSTNAMEFILE $DHCPSCRIPT $DHCPSCRIPT_DEPENDS procd_add_jail_mount $EXTRA_MOUNT $RFC6761FILE $TRUSTANCHORSFILE |