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

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

Issue 540333002: ONC: Fix Static-/Saved-/IPConfig. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 6 years, 3 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
Index: chromeos/network/onc/onc_translator_shill_to_onc.cc
diff --git a/chromeos/network/onc/onc_translator_shill_to_onc.cc b/chromeos/network/onc/onc_translator_shill_to_onc.cc
index 3abb44375c531743470b227a757659f8c48be251..4ac1af40715065d39746233203e02aaf45c58a9e 100644
--- a/chromeos/network/onc/onc_translator_shill_to_onc.cc
+++ b/chromeos/network/onc/onc_translator_shill_to_onc.cc
@@ -466,6 +466,12 @@ void ShillToONCTranslator::TranslateSavedOrStaticIPConfig(
onc_object_->SetWithoutPathExpansion(::onc::ipconfig::kNameServers,
onc_nameservers.release());
}
+ // Static and Saved IPConfig in Shill are always of type IPv4. Set this type
+ // in ONC, but not if the object would be empty except the type.
+ if (!onc_object_->empty()) {
+ onc_object_->SetStringWithoutPathExpansion(::onc::ipconfig::kType,
+ ::onc::ipconfig::kIPv4);
+ }
}
void ShillToONCTranslator::TranslateSavedIPConfig() {

Powered by Google App Engine
This is Rietveld 408576698