现在在分析一个android netd的问题,只要一开启热点,
for (String ifname : added) {try {Log.d(TAG, "TetheredState, processMessage CMD_TETHER_CONNECTION_CHANGED, add mIfaceName =" + mIfaceName + " ifname =" + ifname );mNetd.tetherAddForward(mIfaceName, ifname);mNetd.ipfwdAddInterfaceForward(mIfaceName, ifname);} catch (RemoteException | ServiceSpecificException e) {mLog.e("Exception enabling NAT: " + e.toString());cleanupUpstream();mLastError = TetheringManager.TETHER_ERROR_ENABLE_FORWARDING_ERROR;transitionTo(mInitialState);return true;} }
frameworks/base/packages/Tethering/src/android/net/ip/IpServer.java