diff options
author | John Crispin <blogic@openwrt.org> | 2016-02-26 08:35:48 +0000 |
---|---|---|
committer | John Crispin <blogic@openwrt.org> | 2016-02-26 08:35:48 +0000 |
commit | c3f254470a09f61fd7bd5099b2be77948c438ff5 (patch) | |
tree | 277b04c28638472ebae40debd077e84c419cc4d8 | |
parent | a83e1e412c1499a4bd8e4c25e1207dcd78a5b35c (diff) | |
download | master-187ad058-c3f254470a09f61fd7bd5099b2be77948c438ff5.tar.gz master-187ad058-c3f254470a09f61fd7bd5099b2be77948c438ff5.tar.bz2 master-187ad058-c3f254470a09f61fd7bd5099b2be77948c438ff5.zip |
dnsmasq: add dhcp relay option
Signed-off-by: dbugnar <dnbugnar@ocedo.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@48800 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r-- | package/network/services/dnsmasq/files/dnsmasq.init | 19 |
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 ] && { |