openwrt/package/network/services
blogic 41ed6f55fb dnsmasq: Fix hosts file format when MAC address is not specified
An entry like this in /etc/config/dhcp:

    config 'host'
        option 'name' 'pc2'
        option 'ip' '192.168.100.56'
        option 'dns' '1'

results in a /tmp/hosts/dhcp entry that looks like this:

    192.168.100.56 .lan

Obviously it should say "pc2.lan".

This happens because $name is set to "" in order to support the MAC-less
syntax: "--dhcp-host=lap,192.168.0.199".  Fix this by reordering the
operations.  Also, refuse to add a DNS entry if the hostname or IP is
missing.

Fixes #17683

Reported-by: Kostas Papadopoulos <kpapad75@travelguide.gr>
Signed-off-by: Kevin Cernekee <cernekee@gmail.com>

Backport of r42319

git-svn-id: svn://svn.openwrt.org/openwrt/branches/barrier_breaker@42389 3c298f89-4303-0410-b956-a3cf2f4a3e73
2014-09-01 13:22:06 +00:00
..
authsae create branch for barrier breaker (from trunk r41863) 2014-07-28 23:18:57 +00:00
dnsmasq dnsmasq: Fix hosts file format when MAC address is not specified 2014-09-01 13:22:06 +00:00
dropbear package/*: remove useless explicit set of function returncode 2014-09-01 13:21:54 +00:00
ead create branch for barrier breaker (from trunk r41863) 2014-07-28 23:18:57 +00:00
hostapd hostapd: fix some whitespaces 2014-09-01 13:21:04 +00:00
igmpproxy igmpproxy: add missing include 2014-08-03 11:15:54 +00:00
ipset-dns create branch for barrier breaker (from trunk r41863) 2014-07-28 23:18:57 +00:00
lldpd create branch for barrier breaker (from trunk r41863) 2014-07-28 23:18:57 +00:00
mdns create branch for barrier breaker (from trunk r41863) 2014-07-28 23:18:57 +00:00
odhcpd odhcpd: fix static lease behavior with dhcpv4 2014-08-24 08:13:42 +00:00
openvpn create branch for barrier breaker (from trunk r41863) 2014-07-28 23:18:57 +00:00
openvpn-easy-rsa create branch for barrier breaker (from trunk r41863) 2014-07-28 23:18:57 +00:00
ppp ppp: enable IPv6CP by default 2014-09-01 13:21:11 +00:00
relayd package/*: remove useless explicit set of function returncode 2014-09-01 13:21:54 +00:00
samba36 create branch for barrier breaker (from trunk r41863) 2014-07-28 23:18:57 +00:00
uhttpd BB: uhttpd: do not configure TLS parameters if libustream-ssl is not present 2014-08-25 12:46:35 +00:00