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

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

Issue 267433005: Provide IPConfigs in networkingPrivate.GetProperties (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 7 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_translation_tables.cc ('k') | chromeos/network/shill_property_handler.h » ('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 7716fbf2954d2a49d065b51ce40f0b5ff11d063a..11b802fadeeba7edef3f215161b13ec07c768306 100644
--- a/chromeos/network/onc/onc_translator_shill_to_onc.cc
+++ b/chromeos/network/onc/onc_translator_shill_to_onc.cc
@@ -319,15 +319,17 @@ void ShillToONCTranslator::TranslateIPConfig() {
std::string shill_ip_method;
shill_dictionary_->GetStringWithoutPathExpansion(shill::kMethodProperty,
&shill_ip_method);
- if (shill_ip_method != shill::kTypeIPv4 &&
- shill_ip_method != shill::kTypeIPv6) {
- LOG(ERROR) << "Unhandled IPConfig Method value " << shill_ip_method;
- return;
+ std::string type;
+ if (shill_ip_method == shill::kTypeIPv4 ||
+ shill_ip_method == shill::kTypeDHCP) {
+ type = ::onc::ipconfig::kIPv4;
+ } else if (shill_ip_method == shill::kTypeIPv6 ||
+ shill_ip_method == shill::kTypeDHCP6) {
+ type = ::onc::ipconfig::kIPv6;
+ } else {
+ return; // Ignore unhandled IPConfig types, e.g. bootp, zeroconf, ppp
}
- std::string type = ::onc::ipconfig::kIPv4;
- if (shill_ip_method == shill::kTypeIPv6)
- type = ::onc::ipconfig::kIPv6;
onc_object_->SetStringWithoutPathExpansion(::onc::ipconfig::kType, type);
}
« no previous file with comments | « chromeos/network/onc/onc_translation_tables.cc ('k') | chromeos/network/shill_property_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698