Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Unified Diff: chromeos/network/onc/onc_translator_onc_to_shill.cc

Issue 749013003: ONC: Add IPAddressConfigType and NameServersConfigType (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Alywas use empty dictionary to clear StaticIPConfig properties Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chromeos/network/onc/onc_signature.cc ('k') | chromeos/network/onc/onc_translator_shill_to_onc.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « chromeos/network/onc/onc_signature.cc ('k') | chromeos/network/onc/onc_translator_shill_to_onc.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698