shill: Static IP: Save DHCP-supplied IP parameters
Before Static IP parameters are applied to an IPConfig, save
all DHCP-supplied parameters to corresponding "SavedIP.*"
values in the service. This way the UI can display:
* The current IP address confgured on the interface by
showing the IPConfig value.
* The current user-supplied static IP parameter by showing
the "StaticIP.*" parameter.
* The DHCP-supplied IP parameter by first checking for a
"SavedIP.*" parameter, failing that, using the IPConfig
parameter.
BUG=chromium-os:33223
TEST=New unit test + manual (set StaticIP.Address parameter,
reconnect, and confirm that both SavedIP.Address and StaticIP.Address
parameters are set on the service)
Change-Id: I6410b003bbdc63097a193cfb09881c862dcef5bd
Reviewed-on: https://gerrit.chromium.org/gerrit/29130
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
diff --git a/device.cc b/device.cc
index 4f0851f..13ed6e5 100644
--- a/device.cc
+++ b/device.cc
@@ -415,7 +415,7 @@
CreateConnection();
if (selected_service_) {
ipconfig->ApplyStaticIPParameters(
- selected_service_->static_ip_parameters());
+ selected_service_->mutable_static_ip_parameters());
}
connection_->UpdateFromIPConfig(ipconfig);
// SetConnection must occur after the UpdateFromIPConfig so the