| 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 5300a9d424b5e003ceb66a2c5c9b62c3922b06d1..b073d25e5938709dc834e885a14b252bd57f7ba3 100644
|
| --- a/chromeos/network/onc/onc_translator_onc_to_shill.cc
|
| +++ b/chromeos/network/onc/onc_translator_onc_to_shill.cc
|
| @@ -142,17 +142,39 @@ void LocalTranslator::TranslateEthernet() {
|
|
|
|
|
| void LocalTranslator::TranslateStaticIPConfig() {
|
| - const base::ListValue* onc_nameservers = NULL;
|
| - if (onc_object_->GetListWithoutPathExpansion(::onc::ipconfig::kNameServers,
|
| - &onc_nameservers)) {
|
| - std::vector<std::string> onc_nameservers_vector;
|
| - ConvertListValueToStringVector(*onc_nameservers, &onc_nameservers_vector);
|
| - std::string shill_nameservers = JoinString(onc_nameservers_vector, ',');
|
| - shill_dictionary_->SetStringWithoutPathExpansion(
|
| - shill::kStaticIPNameServersProperty, shill_nameservers);
|
| + const base::ListValue* onc_nameservers_list = NULL;
|
| + onc_object_->GetListWithoutPathExpansion(::onc::ipconfig::kNameServers,
|
| + &onc_nameservers_list);
|
| + if (onc_nameservers_list) {
|
| + if (!onc_nameservers_list->empty()) {
|
| + std::vector<std::string> onc_nameservers_vector;
|
| + ConvertListValueToStringVector(*onc_nameservers_list,
|
| + &onc_nameservers_vector);
|
| + std::string shill_nameservers = JoinString(onc_nameservers_vector, ',');
|
| + shill_dictionary_->SetStringWithoutPathExpansion(
|
| + shill::kStaticIPNameServersProperty, shill_nameservers);
|
| + } else {
|
| + // Empty NameServers entry clears the value.
|
| + shill_dictionary_->SetWithoutPathExpansion(
|
| + shill::kStaticIPNameServersProperty, base::Value::CreateNullValue());
|
| + }
|
| }
|
|
|
| CopyFieldsAccordingToSignature();
|
| +
|
| + // An empty IP Address string indicates 'automatic' configuration; clear all
|
| + // Static IP config properties in Shill.
|
| + std::string address_value;
|
| + if (onc_object_->GetStringWithoutPathExpansion(::onc::ipconfig::kIPAddress,
|
| + &address_value) &&
|
| + address_value.empty()) {
|
| + shill_dictionary_->SetWithoutPathExpansion(shill::kStaticIPAddressProperty,
|
| + base::Value::CreateNullValue());
|
| + shill_dictionary_->SetWithoutPathExpansion(shill::kStaticIPGatewayProperty,
|
| + base::Value::CreateNullValue());
|
| + shill_dictionary_->SetWithoutPathExpansion(
|
| + shill::kStaticIPPrefixlenProperty, base::Value::CreateNullValue());
|
| + }
|
| }
|
|
|
| void LocalTranslator::TranslateOpenVPN() {
|
|
|