summaryrefslogtreecommitdiffstats
path: root/services/core/java/com/android/server/connectivity/Tethering.java
diff options
context:
space:
mode:
authorVinit Deshpande <vinitd@google.com>2015-03-15 13:40:20 -0700
committerVinit Deshpande <vinitd@google.com>2015-03-15 13:40:20 -0700
commitf5fabf1542624005a0e978045bdd117a62ab2593 (patch)
tree5980d89720ad276c8c92780419e324c671038768 /services/core/java/com/android/server/connectivity/Tethering.java
parentf66b06886b8c9a08423c11698a3cb61f0de066f8 (diff)
parent35e36db1d726f5741e7d8d83d2556e1417642be9 (diff)
downloadframeworks_base-f5fabf1542624005a0e978045bdd117a62ab2593.zip
frameworks_base-f5fabf1542624005a0e978045bdd117a62ab2593.tar.gz
frameworks_base-f5fabf1542624005a0e978045bdd117a62ab2593.tar.bz2
am "Separate NAT from forwarding."
merged from goog/mirror-m-wireless-internal-release 35e36db Separate NAT from forwarding.
Diffstat (limited to 'services/core/java/com/android/server/connectivity/Tethering.java')
-rw-r--r--services/core/java/com/android/server/connectivity/Tethering.java11
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 253c196..f9b6270 100644
--- a/services/core/java/com/android/server/connectivity/Tethering.java
+++ b/services/core/java/com/android/server/connectivity/Tethering.java
@@ -979,6 +979,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());
@@ -1031,9 +1037,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) {}