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 9afae3259aaa0cc9bc2fef6c0e481b54f4774f89..8af78d5abdd2327d28f97e348f6301bf846bd86b 100644 |
--- a/chromeos/network/onc/onc_translator_onc_to_shill.cc |
+++ b/chromeos/network/onc/onc_translator_onc_to_shill.cc |
@@ -52,6 +52,7 @@ class LocalTranslator { |
void TranslateFields(); |
private: |
+ void TranslateEthernet(); |
void TranslateOpenVPN(); |
void TranslateVPN(); |
void TranslateWiFi(); |
@@ -86,6 +87,8 @@ class LocalTranslator { |
void LocalTranslator::TranslateFields() { |
if (onc_signature_ == &kNetworkConfigurationSignature) |
TranslateNetworkConfiguration(); |
+ else if (onc_signature_ == &kEthernetSignature) |
+ TranslateEthernet(); |
else if (onc_signature_ == &kVPNSignature) |
TranslateVPN(); |
else if (onc_signature_ == &kOpenVPNSignature) |
@@ -98,6 +101,20 @@ void LocalTranslator::TranslateFields() { |
CopyFieldsAccordingToSignature(); |
} |
+void LocalTranslator::TranslateEthernet() { |
+ std::string authentication; |
+ onc_object_->GetStringWithoutPathExpansion(ethernet::kAuthentication, |
+ &authentication); |
+ |
+ const char* shill_type = flimflam::kTypeEthernet; |
+ if (authentication == ethernet::k8021X) |
+ shill_type = shill::kTypeEthernetEap; |
+ shill_dictionary_->SetStringWithoutPathExpansion(flimflam::kTypeProperty, |
+ shill_type); |
+ |
+ CopyFieldsAccordingToSignature(); |
+} |
+ |
void LocalTranslator::TranslateOpenVPN() { |
// Shill supports only one RemoteCertKU but ONC a list. |
// Copy only the first entry if existing. |
@@ -171,14 +188,17 @@ void LocalTranslator::TranslateEAP() { |
void LocalTranslator::TranslateNetworkConfiguration() { |
std::string type; |
onc_object_->GetStringWithoutPathExpansion(network_config::kType, &type); |
- TranslateWithTableAndSet(type, kNetworkTypeTable, flimflam::kTypeProperty); |
+ |
+ // Set the type except for Ethernet which is set in TranslateEthernet. |
+ if (type != network_type::kEthernet) |
+ TranslateWithTableAndSet(type, kNetworkTypeTable, flimflam::kTypeProperty); |
// Shill doesn't allow setting the name for non-VPN networks. |
if (type == network_type::kVPN) { |
std::string name; |
onc_object_->GetStringWithoutPathExpansion(network_config::kName, &name); |
- shill_dictionary_->SetStringWithoutPathExpansion( |
- flimflam::kNameProperty, name); |
+ shill_dictionary_->SetStringWithoutPathExpansion(flimflam::kNameProperty, |
+ name); |
} |
CopyFieldsAccordingToSignature(); |