[source] dnsmasq: fix dhcp "ignore" option on wwan interfaces

LEDE Commits lede-commits at lists.infradead.org
Mon Sep 18 01:15:03 PDT 2017


dedeckeh pushed a commit to source.git, branch master:
https://git.lede-project.org/feab5fa51e829410ae6c572da282c14e9a7fd86f

commit feab5fa51e829410ae6c572da282c14e9a7fd86f
Author: Marcin Jurkowski <marcin1j at gmail.com>
AuthorDate: Thu Sep 14 14:49:10 2017 +0200

    dnsmasq: fix dhcp "ignore" option on wwan interfaces
    
    Init script won't append --no-dhcp-interface option if interface
    protocol is one of: ncm, directip, qmi, mbim.
    This is caused by IP address assigned to dynamically created netifd
    interfaces. As a result there's no netmask assigned to the main
    interface and dhcp_add() function returns prematurely.
    
    By moving network subnet check we can ensure that --no-dhcp-interface is
    properly generated for wwan interfaces.
    
    Signed-off-by: Marcin Jurkowski <marcin1j at gmail.com>
    Signed-off-by: Hans Dedecker <dedeckeh at gmail.com> [PKG_RELEASE increase; move network checks]
---
 package/network/services/dnsmasq/Makefile           | 2 +-
 package/network/services/dnsmasq/files/dnsmasq.init | 5 +++--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile
index 331e5fa..1e1cc32 100644
--- a/package/network/services/dnsmasq/Makefile
+++ b/package/network/services/dnsmasq/Makefile
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dnsmasq
 PKG_VERSION:=2.77
-PKG_RELEASE:=12
+PKG_RELEASE:=13
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
 PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq/
diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index 6c83b2e..0149643 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -457,9 +457,7 @@ dhcp_add() {
 	config_get networkid "$cfg" networkid
 	[ -n "$networkid" ] || networkid="$net"
 
-	network_get_subnet subnet "$net" || return 0
 	network_get_device ifname "$net" || return 0
-	network_get_protocol proto "$net" || return 0
 
 	[ "$cachelocal" = "0" ] && network_get_dnsserver dnsserver "$net" && {
 		DNS_SERVERS="$DNS_SERVERS $dnsserver"
@@ -471,6 +469,9 @@ dhcp_add() {
 		return 0
 	}
 
+	network_get_subnet subnet "$net" || return 0
+	network_get_protocol proto "$net" || return 0
+
 	# Do not support non-static interfaces for now
 	[ static = "$proto" ] || return 0
 



More information about the lede-commits mailing list