On 26/11/2017 21:02, Daniel Wagner wrote:
> My need was to set the hostname to a well known value. My system
> boots with, lets say, 'host-factory' hostname and during its running
> time the hostname may become 'host-id', where id is a host identifier
> locally defined.
Right, that is something very generic so far.
Sorry, not sure whether I created confusion or not. I meant "My need was
to set the hostname to a well known value" _in the dhcp requests_.
> Also the end-user can manually change the hostname from system gui
> and restart the network, hence connman.
That is your approach to solve the problem. If your GUI apps updates
the hostname, ConnMan could see the change and should the right
thing... If I am not completely mistaken ConnMan would send a new
DHCPREQUEST with the new hostname to update the DNS server.
I really would like to avoid to have two places where you configure
The sack of adding new option is to send a fixed hostname in dhcp
requests, regardless the actual system hostname (which may change).
I understand this can be confusing or unwanted (on the network side you
see a different hostname than the system one), but depending upon the
policy one wants to implement, the config gives the option to set one or
the other behavior.
Here is a usage example, just to better clarify why I went with the
config option way:
ForcedHostname not defined -> connman retrieves the actual system
hostname for the dhcp requests (current behavior)
ForcedHostname = "myhost" -> connman sends 'myhost' as hostname in
dhcp requests. This permits also to send empty hostname, which is not
possible with current implementation.
Maybe the config option could have a better name...
> The problem is that the dhcp request can contain either
> 'host-factory' or 'host-id' depending upon who runs first between
> connman dhcp client and id negotiator component or end-user actions.
Hmm, somehow this sounds a bit racy :)
Indeed. That's why I wanted to have the chance to fix it.
After a bit of pondering I think we should try the monitor approach
first and see if this works or not.