Merge changes Ibb63f6b4,Ib64559a5 into nyc-dev
am: 19e84f7
* commit '19e84f7b750c97d5d7440af16c7ba18bf759e5dc':
Clean up netd state when tethering fails.
Clear LinkProperties on interface removed.
Change-Id: I3e6593324fa955ab3c0e590655d0632347f83ec8
This commit is contained in:
@@ -101,6 +101,19 @@ public class NetlinkTracker extends BaseNetworkObserver {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void interfaceRemoved(String iface) {
|
||||||
|
maybeLog("interfaceRemoved", iface);
|
||||||
|
if (mInterfaceName.equals(iface)) {
|
||||||
|
// Our interface was removed. Clear our LinkProperties and tell our owner that they are
|
||||||
|
// now empty. Note that from the moment that the interface is removed, any further
|
||||||
|
// interface-specific messages (e.g., RTM_DELADDR) will not reach us, because the netd
|
||||||
|
// code that parses them will not be able to resolve the ifindex to an interface name.
|
||||||
|
clearLinkProperties();
|
||||||
|
mCallback.update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addressUpdated(String iface, LinkAddress address) {
|
public void addressUpdated(String iface, LinkAddress address) {
|
||||||
if (mInterfaceName.equals(iface)) {
|
if (mInterfaceName.equals(iface)) {
|
||||||
|
|||||||
@@ -1211,6 +1211,11 @@ public class Tethering extends BaseNetworkObserver {
|
|||||||
Log.e(TAG, "Error Tethering: " + e.toString());
|
Log.e(TAG, "Error Tethering: " + e.toString());
|
||||||
setLastError(ConnectivityManager.TETHER_ERROR_TETHER_IFACE_ERROR);
|
setLastError(ConnectivityManager.TETHER_ERROR_TETHER_IFACE_ERROR);
|
||||||
|
|
||||||
|
try {
|
||||||
|
mNMService.untetherInterface(mIfaceName);
|
||||||
|
} catch (Exception ee) {
|
||||||
|
Log.e(TAG, "Error untethering after failure!" + ee.toString());
|
||||||
|
}
|
||||||
transitionTo(mInitialState);
|
transitionTo(mInitialState);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -302,6 +302,7 @@ public class IpManager extends StateMachine {
|
|||||||
}) {
|
}) {
|
||||||
@Override
|
@Override
|
||||||
public void interfaceAdded(String iface) {
|
public void interfaceAdded(String iface) {
|
||||||
|
super.interfaceAdded(iface);
|
||||||
if (mClatInterfaceName.equals(iface)) {
|
if (mClatInterfaceName.equals(iface)) {
|
||||||
mCallback.setNeighborDiscoveryOffload(false);
|
mCallback.setNeighborDiscoveryOffload(false);
|
||||||
}
|
}
|
||||||
@@ -309,6 +310,7 @@ public class IpManager extends StateMachine {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void interfaceRemoved(String iface) {
|
public void interfaceRemoved(String iface) {
|
||||||
|
super.interfaceRemoved(iface);
|
||||||
if (mClatInterfaceName.equals(iface)) {
|
if (mClatInterfaceName.equals(iface)) {
|
||||||
// TODO: consider sending a message to the IpManager main
|
// TODO: consider sending a message to the IpManager main
|
||||||
// StateMachine thread, in case "NDO enabled" state becomes
|
// StateMachine thread, in case "NDO enabled" state becomes
|
||||||
|
|||||||
Reference in New Issue
Block a user