[source] netifd: fix dns and domain variables pollution in dhcp.script

LEDE Commits lede-commits at lists.infradead.org
Thu Nov 2 10:21:18 PDT 2017


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

commit 82a4b8dd6a0267c50ceb6be98422314a224eea9d
Author: Tero Jänkä <tero.janka at gmail.com>
AuthorDate: Thu Apr 27 20:34:43 2017 +0300

    netifd: fix dns and domain variables pollution in dhcp.script
    
    Unmodified dns and domain variables could be needed in user script (/etc/udhcpc.user).
    
    Signed-off-by: Tero Jänkä <tero.janka at gmail.com>
    Signed-off-by: Hans Dedecker <dedeckeh at gmail.com> (cleanup)
---
 package/network/config/netifd/Makefile                     |  2 +-
 package/network/config/netifd/files/lib/netifd/dhcp.script | 10 ++++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/package/network/config/netifd/Makefile b/package/network/config/netifd/Makefile
index 40bee6c..eba8c3a 100644
--- a/package/network/config/netifd/Makefile
+++ b/package/network/config/netifd/Makefile
@@ -5,7 +5,7 @@ PKG_RELEASE:=1
 
 PKG_SOURCE_PROTO:=git
 PKG_SOURCE_URL=$(LEDE_GIT)/project/netifd.git
-PKG_SOURCE_DATE:=2017-10-19
+PKG_SOURCE_DATE:=2017-10-31
 PKG_SOURCE_VERSION:=0f96606b7040b8e14190ff055d5761744bc15f6d
 PKG_MIRROR_HASH:=9dcfc837b519d021bd2d51acf61c610df0a7e58f9a87d46472fbe0960d3d5dff
 PKG_MAINTAINER:=Felix Fietkau <nbd at nbd.name>
diff --git a/package/network/config/netifd/files/lib/netifd/dhcp.script b/package/network/config/netifd/files/lib/netifd/dhcp.script
index e841f91..24f243c 100755
--- a/package/network/config/netifd/files/lib/netifd/dhcp.script
+++ b/package/network/config/netifd/files/lib/netifd/dhcp.script
@@ -18,10 +18,12 @@ setup_interface () {
 	proto_add_ipv4_address "$ip" "${subnet:-255.255.255.0}"
 	# TODO: apply $broadcast
 
+	local i
 	for i in $router; do
 		proto_add_ipv4_route "$i" 32 "" "$ip"
 		proto_add_ipv4_route 0.0.0.0 0 "$i" "$ip"
 
+		local r
 		for r in $CUSTOMROUTES; do
 			proto_add_ipv4_route "${r%%/*}" "${r##*/}" "$i" "$ip"
 		done
@@ -31,11 +33,11 @@ setup_interface () {
 	[ -n "$staticroutes" ] && set_classless_routes $staticroutes
 	[ -n "$msstaticroutes" ] && set_classless_routes $msstaticroutes
 
-	for dns in $dns; do
-		proto_add_dns_server "$dns"
+	for i in $dns; do
+		proto_add_dns_server "$i"
 	done
-	for domain in $domain; do
-		proto_add_dns_search "$domain"
+	for i in $domain; do
+		proto_add_dns_search "$i"
 	done
 
 	proto_add_data



More information about the lede-commits mailing list