diff options
author | Jo-Philipp Wich <jo@mein.io> | 2017-11-28 11:38:40 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2017-11-28 18:11:25 +0100 |
commit | fcfd5cdb59d25d4bd1ec410f32b452c139f5e288 (patch) | |
tree | 7e9ddf46f1a42e36ca49e7f18ba6db9643ce2c1f /package/network | |
parent | 47fa8654a1358aa63f5be0e51a3738f834de8d86 (diff) | |
download | upstream-fcfd5cdb59d25d4bd1ec410f32b452c139f5e288.tar.gz upstream-fcfd5cdb59d25d4bd1ec410f32b452c139f5e288.tar.bz2 upstream-fcfd5cdb59d25d4bd1ec410f32b452c139f5e288.zip |
dnsmasq: fix dhcp-host entries with empty macs
Due to improper localization of helper variables, "config host" entries
without a given mac address may inherit the mac address of a preceeding,
leading to invalid generated netive configuration.
Fix the issue by marking the "macs" and "tags" helper variables in
dhcp_host_add() local, avoiding the need for explicitely resetting them
with each invocation.
Reported-by: Russell Senior <russell@personaltelco.net>
Tested-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'package/network')
-rw-r--r-- | package/network/services/dnsmasq/files/dnsmasq.init | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index 88c2ce6ebf..2fd56ed4ab 100644 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -277,7 +277,7 @@ dhcp_match_add() { dhcp_host_add() { local cfg="$1" - local hosttag nametime addrs duids + local hosttag nametime addrs duids macs tags config_get_bool force "$cfg" force 0 @@ -305,7 +305,6 @@ dhcp_host_add() { if [ -n "$mac" ]; then # --dhcp-host=00:20:e0:3b:13:af,192.168.0.199,lap # many MAC are possible to track a laptop ON/OFF dock - macs="" for m in $mac; do append macs "$m" ","; done fi @@ -326,7 +325,6 @@ dhcp_host_add() { hex_to_hostid hostid "$hostid" fi - tags="" if [ -n "$tag" ]; then for t in $tag; do append tags "$t" ",set:"; done fi |