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..ed8812de24aa7cd7aa6dc750b4dbcc121d0780bb 100644 |
--- a/chromeos/network/onc/onc_translator_onc_to_shill.cc |
+++ b/chromeos/network/onc/onc_translator_onc_to_shill.cc |
@@ -257,6 +257,22 @@ void LocalTranslator::TranslateNetworkConfiguration() { |
if (type == ::onc::network_type::kVPN) |
CopyFieldFromONCToShill(::onc::network_config::kName, shill::kNameProperty); |
+ // If both IPAddressConfigType and NameServersConfigType are set to DHCP, |
pneubeck (no reviews)
2015/01/06 10:57:46
Just to clarify that we understand what this trans
stevenjb
2015/01/06 17:12:30
If *neither* Type is set, then StaticIPConfig will
|
+ // provide an empty StaticIPConfig property so that any existing properties |
+ // will be cleared. Note: if either is set to Static, then a StaticIPConfig |
+ // object will be provided which will specify any static properties (and any |
+ // unspecified properties will be cleared). |
+ 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)) { |
+ shill_dictionary_->SetWithoutPathExpansion(shill::kStaticIPConfigProperty, |
+ base::Value::CreateNullValue()); |
pneubeck (no reviews)
2015/01/04 11:18:01
can't we just set an empty dictionary? i thought t
stevenjb
2015/01/05 21:16:19
Setting this to an empty Dictionary means changing
pneubeck (no reviews)
2015/01/06 10:57:46
Shouldn't it affect exactly the test cases that yo
stevenjb
2015/01/06 17:12:30
I think I misunderstood. The else clause I added s
|
+ } |
+ |
CopyFieldsAccordingToSignature(); |
} |