shill: fix passing host name property to DHCP v4 request
https://android-review.googlesource.com/c/platform/system/connectivity/shill/+/181040
replaced the "HostName" property in the Manager interface with a new
"DHCPProperty.Hostname" property. However, the migration was partially
done. The Manager.SetProperty D-Bus API still accepts the deprecated
HostName property but not the DHCPProperty.Hostname property. Also, the
DHCPProperty.Hostname property is not stored to or loaded from the
default profile. When merging the DHCP properties held by Manager and a
service, the host name isn't propagated correctly, which results in
shill not passing the `-h <hostname>` option to dhcpcd under IPv4.
BUG=chromium:852035
CQ-DEPEND=CL:1101913
TEST=Tested the following:
1. Set the DHCPProperty.Hostname property
dbus-send --system --print-reply \
--dest=org.chromium.flimflam / org.chromium.flimflam.Manager.SetProperty \
string:DHCPProperty.Hostname string:test-hostname
2. Restart shill
3. Verify that DHCPProperty.HostName=test-hostname is set in the global
section of /var/cache/shill/default.profile.
4. Connect the device to Ethernet.
5. Verify that dhcpcd is running with `-h test-hostname` option.
Change-Id: Ib94a3b03a871beb03c5061f593fbcbd1f3234788
Reviewed-on: https://chromium-review.googlesource.com/1102152
Commit-Ready: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
2 files changed