diff options
author | Lorenzo Colitti <lorenzo@google.com> | 2014-10-16 08:45:02 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-10-16 08:45:03 +0000 |
commit | 917c547beb9adecf2e7d2b355e85e37c2557c5d3 (patch) | |
tree | 47eb890f13f0798cea9dab1d1f0f2d128f81a889 /services | |
parent | 28dcf0345b2857884c1f1639fadb720318445187 (diff) | |
parent | 02c7abac856c3e94f4a2714d673cefb65c55efb7 (diff) | |
download | frameworks_base-917c547beb9adecf2e7d2b355e85e37c2557c5d3.zip frameworks_base-917c547beb9adecf2e7d2b355e85e37c2557c5d3.tar.gz frameworks_base-917c547beb9adecf2e7d2b355e85e37c2557c5d3.tar.bz2 |
Merge "Don't make lockdown VPN source firewall rules over-broad." into lmp-dev
Diffstat (limited to 'services')
-rw-r--r-- | services/core/java/com/android/server/net/LockdownVpnTracker.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/services/core/java/com/android/server/net/LockdownVpnTracker.java b/services/core/java/com/android/server/net/LockdownVpnTracker.java index e9c7751..cf0aba4 100644 --- a/services/core/java/com/android/server/net/LockdownVpnTracker.java +++ b/services/core/java/com/android/server/net/LockdownVpnTracker.java @@ -190,7 +190,7 @@ public class LockdownVpnTracker { mNetService.setFirewallInterfaceRule(iface, true); for (LinkAddress addr : sourceAddrs) { - mNetService.setFirewallEgressSourceRule(addr.toString(), true); + setFirewallEgressSourceRule(addr, true); } mErrorCount = 0; @@ -277,7 +277,7 @@ public class LockdownVpnTracker { } if (mAcceptedSourceAddr != null) { for (LinkAddress addr : mAcceptedSourceAddr) { - mNetService.setFirewallEgressSourceRule(addr.toString(), false); + setFirewallEgressSourceRule(addr, false); } mAcceptedSourceAddr = null; } @@ -286,6 +286,14 @@ public class LockdownVpnTracker { } } + private void setFirewallEgressSourceRule( + LinkAddress address, boolean allow) throws RemoteException { + // Our source address based firewall rules must only cover our own source address, not the + // whole subnet + final String addrString = address.getAddress().getHostAddress(); + mNetService.setFirewallEgressSourceRule(addrString, allow); + } + public void onNetworkInfoChanged() { synchronized (mStateLock) { handleStateChangedLocked(); |