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

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: Fixed another unit test. 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
« no previous file with comments | « chromeos/network/onc/onc_translator_onc_to_shill.cc ('k') | chromeos/network/onc/onc_validator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 168f0b14597c546d847a2d6b4000dc03efde43b1..900ec21c705bea688f1b62e4d85b3d1888de5303 100644
--- a/chromeos/network/onc/onc_translator_shill_to_onc.cc
+++ b/chromeos/network/onc/onc_translator_shill_to_onc.cc
@@ -477,6 +477,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() {
« no previous file with comments | « chromeos/network/onc/onc_translator_onc_to_shill.cc ('k') | chromeos/network/onc/onc_validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698