Skip adding ingress discard rule to OEM VPN
OEM VPNs might need to receive packets to VPN address via non-VPN interface. Bug: 352424251 Test: CsIngressDiscardRuleTest Change-Id: Ia9000bcbb5b3b9e1e0d396ba78946be36e2fc5ba
This commit is contained in:
parent
89a81a15be
commit
c14288f7c7
1 changed files with 32 additions and 11 deletions
|
|
@ -9672,10 +9672,10 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||
* interfaces.
|
||||
* Ingress discard rule is added to the address iff
|
||||
* 1. The address is not a link local address
|
||||
* 2. The address is used by a single non-Legacy VPN interface and not used by any other
|
||||
* interfaces even non-VPN ones
|
||||
* Ingress discard rule is not be added to Legacy VPN since some Legacy VPNs need to receive
|
||||
* packet to VPN address via non-VPN interface.
|
||||
* 2. The address is used by a single interface of VPN whose VPN type is not TYPE_VPN_LEGACY
|
||||
* or TYPE_VPN_OEM and the address is not used by any other interfaces even non-VPN ones
|
||||
* Ingress discard rule is not be added to TYPE_VPN_LEGACY or TYPE_VPN_OEM VPN since these VPNs
|
||||
* might need to receive packet to VPN address via non-VPN interface.
|
||||
* This method can be called during network disconnects, when nai has already been removed from
|
||||
* mNetworkAgentInfos.
|
||||
*
|
||||
|
|
@ -9710,8 +9710,10 @@ public class ConnectivityService extends IConnectivityManager.Stub
|
|||
// for different network.
|
||||
final Set<Pair<InetAddress, String>> ingressDiscardRules = new ArraySet<>();
|
||||
for (final NetworkAgentInfo agent : nais) {
|
||||
final int vpnType = getVpnType(agent);
|
||||
if (!agent.isVPN() || agent.isDestroyed()
|
||||
|| getVpnType(agent) == VpnManager.TYPE_VPN_LEGACY) {
|
||||
|| vpnType == VpnManager.TYPE_VPN_LEGACY
|
||||
|| vpnType == VpnManager.TYPE_VPN_OEM) {
|
||||
continue;
|
||||
}
|
||||
final LinkProperties agentLp = (nai == agent) ? lp : agent.linkProperties;
|
||||
|
|
|
|||
Loading…
Reference in a new issue