dnsmasq: rework network interface ignore master
authorYegor Yefremov <yegorslists@googlemail.com>
Thu, 15 Feb 2024 08:43:09 +0000 (09:43 +0100)
committerJo-Philipp Wich <jo@mein.io>
Thu, 22 Feb 2024 08:15:01 +0000 (09:15 +0100)
In some situations (slow protocol or interfaces with auto 0), the
interfaces are not available during the dnsmasq initialization and
hence, the ignore setting will be skipped.

Install an interface trigger for ignored interfaces in case their
ifname cannot be resolved.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
[bump PKG_RELEASE]
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
package/network/services/dnsmasq/Makefile
package/network/services/dnsmasq/files/dnsmasq.init

index 666f4846f55141a17094291946ffb9a17326590b..122e9b900e7dbf220a6f3d3e0efedeec7b63c3c5 100644 (file)
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
 PKG_NAME:=dnsmasq
 PKG_UPSTREAM_VERSION:=2.89
 PKG_VERSION:=$(subst test,~~test,$(subst rc,~rc,$(PKG_UPSTREAM_VERSION)))
-PKG_RELEASE:=7
+PKG_RELEASE:=8
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_UPSTREAM_VERSION).tar.xz
 PKG_SOURCE_URL:=https://thekelleys.org.uk/dnsmasq/
index d6c126565efe75c9bca4f48822ef477097261cf5..c5e673029187555d1a81e8ec88fefb18b39c08d1 100755 (executable)
@@ -1253,10 +1253,11 @@ dnsmasq_stop()
 
 add_interface_trigger()
 {
-       local interface ignore
+       local interface ifname ignore
 
        config_get interface "$1" interface
        config_get_bool ignore "$1" ignore 0
+       network_get_device ifname "$interface" || ignore=0
 
        [ -n "$interface" ] && [ $ignore -eq 0 ] && procd_add_interface_trigger "interface.*" "$interface" /etc/init.d/dnsmasq reload
 }