aboutsummaryrefslogtreecommitdiffstats
path: root/package/network
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2016-02-26 08:35:48 +0000
committerJohn Crispin <john@openwrt.org>2016-02-26 08:35:48 +0000
commitc503984876e223801e7882e8499718f860f574ea (patch)
treee26f5e7ad56598d6ac140d014fc1adc7bd75fb50 /package/network
parent4f3c1e779364394a7e8f9f45ee824e0dff556cec (diff)
downloadupstream-c503984876e223801e7882e8499718f860f574ea.tar.gz
upstream-c503984876e223801e7882e8499718f860f574ea.tar.bz2
upstream-c503984876e223801e7882e8499718f860f574ea.zip
dnsmasq: add dhcp relay option
Signed-off-by: dbugnar <dnbugnar@ocedo.com> SVN-Revision: 48800
Diffstat (limited to 'package/network')
-rw-r--r--package/network/services/dnsmasq/files/dnsmasq.init19
1 files changed, 19 insertions, 0 deletions
diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init
index 90e3dc4d39..0904503fac 100644
--- a/package/network/services/dnsmasq/files/dnsmasq.init
+++ b/package/network/services/dnsmasq/files/dnsmasq.init
@@ -546,6 +546,24 @@ dhcp_hostrecord_add() {
xappend "--host-record=$record"
}
+dhcp_relay_add() {
+ local cfg="$1"
+ local local_addr server_addr interface
+
+ config_get local_addr "$cfg" local_addr
+ [ -n "$local_addr" ] || return 0
+
+ config_get server_addr "$cfg" server_addr
+ [ -n "$server_addr" ] || return 0
+
+ config_get interface "$cfg" interface
+ if [ -z "$interface" ]; then
+ xappend "--dhcp-relay=$local_addr,$server_addr"
+ else
+ xappend "--dhcp-relay=$local_addr,$server_addr,$interface"
+ fi
+}
+
service_triggers()
{
procd_add_reload_trigger "dhcp"
@@ -594,6 +612,7 @@ start_service() {
config_foreach dhcp_subscrid_add subscrid
config_foreach dhcp_domain_add domain
config_foreach dhcp_hostrecord_add hostrecord
+ config_foreach dhcp_relay_add relay
# add own hostname
[ $ADD_LOCAL_HOSTNAME -eq 1 ] && {