r29375 added a feature that provides A and PTR records mapping between the
device's own hostname (uci get system.@system[0].hostname) and LAN IP address
(uci get network.lan.ipaddr). For situations where this is undesirable,
the new "insert_lanaddr" option in the "config dnsmasq" section of
/etc/config/dhcp can be used. The default is on, producing the current
behavior. Setting it to off prevents this automatic mapping from being
inserted into the dnsmasq configuration.

Signed-off-by: Mark Mentovai <m...@moxienet.com>

Index: package/dnsmasq/files/dnsmasq.init
===================================================================
--- package/dnsmasq/files/dnsmasq.init  (revision 31782)
+++ package/dnsmasq/files/dnsmasq.init  (working copy)
@@ -7,6 +7,7 @@
 
 DNS_SERVERS=""
 DOMAIN=""
+INSERT_LANADDR=1
 
 CONFIGFILE="/var/etc/dnsmasq.conf"
 
@@ -109,6 +110,7 @@
        append_parm "$cfg" "dhcp_boot" "--dhcp-boot"
 
        config_get DOMAIN "$cfg" domain
+       config_get_bool INSERT_LANADDR "$cfg" insert_lanaddr 1
 
        config_get_bool readethers "$cfg" readethers
        [ "$readethers" = "1" -a \! -e "/etc/ethers" ] && touch /etc/ethers
@@ -451,7 +453,7 @@
        echo >> $CONFIGFILE
 
        # add own hostname
-       [ -z "$lanaddr" ] || {
+       [ "$INSERT_LANADDR" -ne 0 ] && [ -n "$lanaddr" ] && {
                local hostname="$(uci_get system.@system[0].hostname)"
                dhcp_domain_add "" "${hostname:-OpenWrt}" "$lanaddr"
        }
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to