From abdf0dea3ab6470b596096635a60fbe2e8d0dfff Mon Sep 17 00:00:00 2001 From: Mathias Kresin Date: Fri, 8 Dec 2017 09:35:26 +0100 Subject: [PATCH] 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 --- package/network/config/netifd/files/lib/netifd/proto/dhcp.sh | 1 + 1 file changed, 1 insertion(+) 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" -- 2.30.2