diff options
author | Irfan Sheriff <isheriff@google.com> | 2011-01-17 12:38:30 -0800 |
---|---|---|
committer | Irfan Sheriff <isheriff@google.com> | 2011-03-25 10:09:55 -0700 |
commit | c0e0dbb45446e5e0f7f131f2180c946778e7d711 (patch) | |
tree | 113a0d6b4140a16bda3c5430680c560fd3592209 /services | |
parent | ff5a09904fb05f2776f1bbf1dd3915f38031190c (diff) | |
download | frameworks_base-c0e0dbb45446e5e0f7f131f2180c946778e7d711.zip frameworks_base-c0e0dbb45446e5e0f7f131f2180c946778e7d711.tar.gz frameworks_base-c0e0dbb45446e5e0f7f131f2180c946778e7d711.tar.bz2 |
DO NOT MERGE Pick upstream intf with valid IP conf
As a work around for the issue of picking
the wrong interface, add a check for selecting
an upstream interface that has a valid IP configuration
Bug: 3362306
Change-Id: I3e8ab5ef30b69f1adab755d83f5b65c078f73936
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/connectivity/Tethering.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/services/java/com/android/server/connectivity/Tethering.java b/services/java/com/android/server/connectivity/Tethering.java index f774b29..1ec9b51 100644 --- a/services/java/com/android/server/connectivity/Tethering.java +++ b/services/java/com/android/server/connectivity/Tethering.java @@ -1173,18 +1173,18 @@ public class Tethering extends INetworkManagementEventObserver.Stub { for (String iface : ifaces) { for (String regex : mUpstreamIfaceRegexs) { if (iface.matches(regex)) { - // verify it is up! + // verify it is active InterfaceConfiguration ifcg = null; try { ifcg = service.getInterfaceConfig(iface); + if (ifcg.isActive()) { + return iface; + } } catch (Exception e) { Log.e(TAG, "Error getting iface config :" + e); // ignore - try next continue; } - if (ifcg.interfaceFlags.contains("up")) { - return iface; - } } } } |