Skip to content

Commit

Permalink
netifd: always send DHCPv4 hostname
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mkresin committed Dec 8, 2017
1 parent 93bd46b commit abdf0de
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit abdf0de

Please sign in to comment.