diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2015-02-26 01:25:36 +0900 |
---|---|---|
committer | Lorenzo Colitti <lorenzo@google.com> | 2015-02-27 15:53:28 +0900 |
commit | 35e36db1d726f5741e7d8d83d2556e1417642be9 (patch) | |
tree | c182237d120c276b086d4b6dad12093924cc7790 /services/core/java/com/android/server/connectivity/Tethering.java | |
parent | f3d4a58519d6bf8e74ac035aeb845bff6dc12aa4 (diff) | |
download | frameworks_base-35e36db1d726f5741e7d8d83d2556e1417642be9.zip frameworks_base-35e36db1d726f5741e7d8d83d2556e1417642be9.tar.gz frameworks_base-35e36db1d726f5741e7d8d83d2556e1417642be9.tar.bz2 |
Separate NAT from forwarding.
Bug: 19500693
Change-Id: I39878644e21d51def1c31d1857e815f473ef0938
Diffstat (limited to 'services/core/java/com/android/server/connectivity/Tethering.java')
-rw-r--r-- | services/core/java/com/android/server/connectivity/Tethering.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/connectivity/Tethering.java b/services/core/java/com/android/server/connectivity/Tethering.java index 9566f93..5ff7022 100644 --- a/services/core/java/com/android/server/connectivity/Tethering.java +++ b/services/core/java/com/android/server/connectivity/Tethering.java @@ -981,6 +981,12 @@ public class Tethering extends BaseNetworkObserver { if (VDBG) Log.e(TAG, "Exception in forceUpdate: " + e.toString()); } try { + mNMService.stopInterfaceForwarding(mIfaceName, mMyUpstreamIfaceName); + } catch (Exception e) { + if (VDBG) Log.e( + TAG, "Exception in removeInterfaceForward: " + e.toString()); + } + try { mNMService.disableNat(mIfaceName, mMyUpstreamIfaceName); } catch (Exception e) { if (VDBG) Log.e(TAG, "Exception in disableNat: " + e.toString()); @@ -1033,9 +1039,14 @@ public class Tethering extends BaseNetworkObserver { if (newUpstreamIfaceName != null) { try { mNMService.enableNat(mIfaceName, newUpstreamIfaceName); + mNMService.startInterfaceForwarding(mIfaceName, + newUpstreamIfaceName); } catch (Exception e) { Log.e(TAG, "Exception enabling Nat: " + e.toString()); try { + mNMService.disableNat(mIfaceName, newUpstreamIfaceName); + } catch (Exception ee) {} + try { mNMService.untetherInterface(mIfaceName); } catch (Exception ee) {} |