From: Mathias Kresin Date: Fri, 8 Dec 2017 08:35:26 +0000 (+0100) Subject: netifd: always send DHCPv4 hostname X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=abdf0dea3ab6470b596096635a60fbe2e8d0dfff;p=openwrt%2Fstaging%2Fkaloz.git netifd: always send DHCPv4 hostname udhcpc doesn't send a hostname by default. Use the system hostname if nothing else is specified, to always send a hostname. It syncs the behaviour to odhcpc, which always sends a hostname. Signed-off-by: Mathias Kresin Acked-by: Stijn Tintel Acked-by: Hans Dedecker --- diff --git a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh index ea02d68bb4..143e4451b6 100755 --- a/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh +++ b/package/network/config/netifd/files/lib/netifd/proto/dhcp.sh @@ -40,6 +40,7 @@ proto_dhcp_setup() { append dhcpopts "-x $opt" done + [ -z "$hostname" ] && hostname="$(cat /proc/sys/kernel/hostname)" [ "$broadcast" = 1 ] && broadcast="-B" || broadcast= [ "$release" = 1 ] && release="-R" || release= [ -n "$clientid" ] && clientid="-x 0x3d:${clientid//:/}" || clientid="-C"