dnsmasq: fix dhcp-host entries with empty macs
authorJo-Philipp Wich <jo@mein.io>
Tue, 28 Nov 2017 11:38:40 +0000 (11:38 +0000)
committerJo-Philipp Wich <jo@mein.io>
Tue, 28 Nov 2017 17:11:25 +0000 (18:11 +0100)
commitfcfd5cdb59d25d4bd1ec410f32b452c139f5e288
tree7e9ddf46f1a42e36ca49e7f18ba6db9643ce2c1f
parent47fa8654a1358aa63f5be0e51a3738f834de8d86
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>
package/network/services/dnsmasq/files/dnsmasq.init