diff --git a/services/core/java/com/android/server/connectivity/Tethering.java b/services/core/java/com/android/server/connectivity/Tethering.java index 00947f13aa9b0..561245e4a3055 100644 --- a/services/core/java/com/android/server/connectivity/Tethering.java +++ b/services/core/java/com/android/server/connectivity/Tethering.java @@ -868,7 +868,12 @@ private void enableWifiIpServingLocked(String ifname, int wifiIpMode) { } if (!TextUtils.isEmpty(ifname)) { - maybeTrackNewInterfaceLocked(ifname, TETHERING_WIFI); + final int interfaceType = ifaceNameToType(ifname); + if (interfaceType == TETHERING_INVALID) { + mLog.log(ifname + " is not a tetherable iface, ignoring"); + return; + } + maybeTrackNewInterfaceLocked(ifname, interfaceType); changeInterfaceState(ifname, ipServingMode); } else { mLog.e(String.format( diff --git a/services/net/java/android/net/ip/IpServer.java b/services/net/java/android/net/ip/IpServer.java index 47d01a0c6b32e..c61134962fa80 100644 --- a/services/net/java/android/net/ip/IpServer.java +++ b/services/net/java/android/net/ip/IpServer.java @@ -426,7 +426,8 @@ private boolean configureIPv4(boolean enabled) { InetAddress addr = numericToInetAddress(ipAsString); linkAddr = new LinkAddress(addr, prefixLen); ifcg.setLinkAddress(linkAddr); - if (mInterfaceType == ConnectivityManager.TETHERING_WIFI) { + if (mInterfaceType == ConnectivityManager.TETHERING_WIFI || + mInterfaceType == ConnectivityManager.TETHERING_WIGIG) { // The WiFi stack has ownership of the interface up/down state. // It is unclear whether the Bluetooth or USB stacks will manage their own // state.