[OpenWrt-Devel] [PATCH] dnsmasq: Make parameters optional in dhcpboot config

Stefan Tomanek stefan.tomanek+openwrt at wertarbyte.de
Sat Feb 21 17:53:56 EST 2015


The --dhcp-boot option of dnsmasq does not require servername and serveraddress
arguments if the builtin tftp server is used.

Signed-off-by: Stefan Tomanek <stefan.tomanek+openwrt at wertarbyte.de>
---
 .../network/services/dnsmasq/files/dnsmasq.init    |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index 40ec584..fb118d5 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -364,12 +364,11 @@ dhcp_boot_add() {
 	[ -n "$filename" ] || return 0
 
 	config_get servername "$cfg" servername
-	[ -n "$servername" ] || return 0
-
 	config_get serveraddress "$cfg" serveraddress
-	[ -n "$serveraddress" ] || return 0
 
-	xappend "--dhcp-boot=${networkid:+net:$networkid,}$filename,$servername,$serveraddress"
+	[ -n "$serveraddress" -a ! -n "$servername" ] && return 0
+
+	xappend "--dhcp-boot=${networkid:+net:$networkid,}${filename}${servername:+,$servername}${serveraddress:+,$serveraddress}"
 
 	config_get_bool force "$cfg" force 0
 
-- 
1.7.2.5
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list