I'm not sure which approach would be the better one: I'm fine with both.
So here is the variant with second bool parameter.

---

Index: package/base-files/files/lib/network/config.sh
===================================================================
--- package/base-files/files/lib/network/config.sh      (revision 27363)
+++ package/base-files/files/lib/network/config.sh      (working copy)
@@ -358,11 +358,17 @@
                        config_get clientid "$config" clientid
                        config_get vendorid "$config" vendorid
                        config_get_bool broadcast "$config" broadcast 0
+                       config_get_bool send_hostname "$config" send_hostname 1
                        config_get reqopts "$config" reqopts
 
                        [ -z "$ipaddr" ] || \
                                $DEBUG ifconfig "$iface" "$ipaddr" 
${netmask:+netmask "$netmask"}
 
+                       # send system's hostname to upstream by default if none 
is explicitly configured;
+                       # but suppress sending if option 'send_hostname' 
prohibits it
+                       [ -n "$hostname" ] || hostname=$(uci -q get 
system.@system[0].hostname)
+                       [ "$send_hostname" = 1 ] || hostname=""
+
                        # additional request options
                        local opt dhcpopts
                        for opt in $reqopts; do
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to