Check for pseudo devices earlier so they are not classified as tunnels.
BUG=none
TEST=network_3GPseudoModemControl
Change-Id: I025d29712f22ce09c43550cc2c66fb27254ad9f9
Reviewed-on: https://gerrit.chromium.org/gerrit/23070
Tested-by: Jason Glasgow <jglasgow@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Jason Glasgow <jglasgow@chromium.org>
diff --git a/device_info.cc b/device_info.cc
index fce8104..d4d5f27 100644
--- a/device_info.cc
+++ b/device_info.cc
@@ -196,6 +196,14 @@
return Technology::kWifi;
}
+ // Special case for pseudo modems which are used for testing
+ if (iface_name.find(kModemPseudoDeviceNamePrefix) == 0) {
+ SLOG(Device, 2) << StringPrintf(
+ "%s: device %s is a pseudo modem for testing",
+ __func__, iface_name.c_str());
+ return Technology::kCellular;
+ }
+
FilePath driver_path;
if (!GetDeviceInfoSymbolicLink(iface_name, kInterfaceDriver, &driver_path)) {
SLOG(Device, 2) << StringPrintf("%s: device %s has no device symlink",
@@ -250,14 +258,6 @@
return Technology::kCellular;
}
- // Special case for pseudo modems which are used for testing
- if (iface_name.find(kModemPseudoDeviceNamePrefix) == 0) {
- SLOG(Device, 2) << StringPrintf(
- "%s: device %s is a pseudo modem for testing",
- __func__, iface_name.c_str());
- return Technology::kCellular;
- }
-
// Special case for the virtio driver, used when run under KVM. See also
// the comment in VirtioEthernet::Start.
if (driver_name == kDriverVirtioNet) {