Index: chromeos/network/onc/onc_translator_onc_to_shill.cc |
diff --git a/chromeos/network/onc/onc_translator_onc_to_shill.cc b/chromeos/network/onc/onc_translator_onc_to_shill.cc |
index 8e30af55446f6889b6c35922c488bf602039aae8..194be93939d9b7341604142937c8652ef0660154 100644 |
--- a/chromeos/network/onc/onc_translator_onc_to_shill.cc |
+++ b/chromeos/network/onc/onc_translator_onc_to_shill.cc |
@@ -257,6 +257,19 @@ void LocalTranslator::TranslateNetworkConfiguration() { |
if (type == ::onc::network_type::kVPN) |
CopyFieldFromONCToShill(::onc::network_config::kName, shill::kNameProperty); |
+ std::string ip_address_config_type, name_servers_config_type; |
+ onc_object_->GetStringWithoutPathExpansion( |
+ ::onc::network_config::kIPAddressConfigType, &ip_address_config_type); |
+ onc_object_->GetStringWithoutPathExpansion( |
+ ::onc::network_config::kNameServersConfigType, &name_servers_config_type); |
+ if ((ip_address_config_type == ::onc::network_config::kIPConfigTypeDHCP) || |
+ (name_servers_config_type == ::onc::network_config::kIPConfigTypeDHCP)) { |
+ // If either type is set to DHCP, provide an empty dictionary to ensure |
+ // that any unset properties are cleared. Note: if either type is specified, |
+ // the other type defaults to DHCP if not specified. |
+ shill_dictionary_->SetWithoutPathExpansion(shill::kStaticIPConfigProperty, |
+ new base::DictionaryValue); |
+ } |
CopyFieldsAccordingToSignature(); |
} |