Currently, the hostname is sent in a DHCP request only if configured 
explicitely.

Changing this behaviour so that the hostname is sent per default has the 
advantage
that e.g. a Fritz!Box (acting as DHCP server) shows the device running OpenWRT
with it's hostname in the network overview.

To prevent sending a hostname at all (and to be backwards compatible) the
configuration option can be set to "none".

Signed-off-by: Michael Heimpold <[email protected]>

Index: package/base-files/files/lib/network/config.sh
===================================================================
--- package/base-files/files/lib/network/config.sh      (Revision 23604)
+++ package/base-files/files/lib/network/config.sh      (Arbeitskopie)
@@ -355,6 +355,8 @@
 
                        [ -z "$ipaddr" ] || \
                                $DEBUG ifconfig "$iface" "$ipaddr" 
${netmask:+netmask "$netmask"}
+                       [ -n "$hostname" ] || hostname=$(uci -q get 
syst...@system[0].hostname)
+                       [ "$hostname" = "none" ] && hostname=""
 
                        # don't stay running in background if dhcp is not the 
main proto on the interface (e.g. when using pptp)
                        local dhcpopts
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to