[LEDE-DEV] [PATCH] netifd: always send DHCPv4 hostname
Mathias Kresin
dev at kresin.me
Fri Dec 8 12:58:44 PST 2017
08.12.2017 21:14, Daniel Golle:
> Hi Mathias,
>
> On Fri, Dec 08, 2017 at 09:35:26AM +0100, Mathias Kresin wrote:
>> 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.
>
> Could we somehow allow to deliberately not send any hostname?
At least in context of this patch it's to late. I pushed the patch
minutes prior your mail.
> ISC dhcpcd allows setting it to 'null' or 'localhost' for that
> purpose.
> There are two possible uses for not sending the hostname in the DHCP
> request:
> i) expecting the hostname to be assigned by the DHCP server
Shouldn't work it anyway by using the request hostname option?
> ii) minimizing the amount of identifyable bits being sent, e.g.
> when connecting to public networks
Exactly that was the reason why I send the patch to the mailing list
first. I wasn't sure if the absence of a default send hostname is
considered as feature or a bug. After receiving the ACKs it was pretty
much clear to me that it's considered as bug by others as well.
Nevertheless I thought about this use case as well, but couldn't find a
satisfying solution using the existing hostname uci option. I consider
the strings 'null' and 'localhost' as valid hostnames.
To my knowledge it isn't possible to pass NULL via uci and therefore
it's impossible to distinguish whether the hostname was intentional set
to nothing or it's expected that the systems hostname is send by default
(as it's done by all dhcp clients I have seen so far).
I was surprised to see that there was a mismatch in what is done for
DHCPv4 (udhcpc) and DHCPv6 (odhcpc). I prefer to have the possible to
create a DNS record - based on the send hostname - for dhcp clients by
default and considered this issue as more pressing. But as usual, it
depends on the use case.
Mathias
More information about the Lede-dev
mailing list