diff options
author | Mathias Kresin <dev@kresin.me> | 2017-12-08 09:35:26 +0100 |
---|---|---|
committer | Mathias Kresin <dev@kresin.me> | 2017-12-08 21:00:26 +0100 |
commit | abdf0dea3ab6470b596096635a60fbe2e8d0dfff (patch) | |
tree | 5d08a1b634cf76a04b413bf1d1d8573f22cf1210 | |
parent | 93bd46b719dc54076a8e6e6efb3259c7417375b6 (diff) | |
download | mtk-20170518-abdf0dea3ab6470b596096635a60fbe2e8d0dfff.zip mtk-20170518-abdf0dea3ab6470b596096635a60fbe2e8d0dfff.tar.gz mtk-20170518-abdf0dea3ab6470b596096635a60fbe2e8d0dfff.tar.bz2 |
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 <dev@kresin.me>
Acked-by: Stijn Tintel <stijn@linux-ipv6.be>
Acked-by: Hans Dedecker <dedeckeh@gmail.com>
-rwxr-xr-x | package/network/config/netifd/files/lib/netifd/proto/dhcp.sh | 1 |
1 files changed, 1 insertions, 0 deletions
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 ea02d68..143e445 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" |