summaryrefslogtreecommitdiffstats
path: root/ipacm/src/IPACM_Wan.cpp
diff options
context:
space:
mode:
authorMichael Bestas <mkbestas@lineageos.org>2020-03-18 19:04:14 +0200
committerMichael Bestas <mkbestas@lineageos.org>2020-03-18 19:04:14 +0200
commit58f731cb1ba1c84ba5f241f73f0853d1c1d09e8a (patch)
tree49b24caf8ad1afb2979004efb4b6be2ba4d6d967 /ipacm/src/IPACM_Wan.cpp
parent109aa1e7c66501568cc685c1ad92342e3b1398c3 (diff)
parent34180a4f5db2746e99b3aa1dec3b9518c6877335 (diff)
downloadandroid_vendor_qcom_opensource_data-ipa-cfg-mgr-lineage-17.1.tar.gz
android_vendor_qcom_opensource_data-ipa-cfg-mgr-lineage-17.1.tar.bz2
android_vendor_qcom_opensource_data-ipa-cfg-mgr-lineage-17.1.zip
Merge tag 'LA.UM.8.1.r1-14500-sm8150.0' of https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/data-ipa-cfg-mgr into lineage-17.1HEADlineage-17.1
"LA.UM.8.1.r1-14500-sm8150.0" Change-Id: I5069878624b0329212960e53d328143e6dd5c4b0
Diffstat (limited to 'ipacm/src/IPACM_Wan.cpp')
-rw-r--r--ipacm/src/IPACM_Wan.cpp103
1 files changed, 1 insertions, 102 deletions
diff --git a/ipacm/src/IPACM_Wan.cpp b/ipacm/src/IPACM_Wan.cpp
index 7f450e1..6e7c961 100644
--- a/ipacm/src/IPACM_Wan.cpp
+++ b/ipacm/src/IPACM_Wan.cpp
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
+Copyright (c) 2013-2020 The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -4273,9 +4273,6 @@ int IPACM_Wan::config_wan_firewall_rule(ipa_ip_type iptype)
}
else if(iptype == IPA_IP_v6)
{
-#ifdef FEATURE_IPA_ANDROID
- add_tcpv6_filtering_rule(flt_rule_v6, IPACM_Wan::num_v6_flt_rule);
-#endif
IPACM_Wan::num_v6_flt_rule = IPA_V2_NUM_DEFAULT_WAN_FILTER_RULE_IPV6;
if(IPACM_FAILURE == add_icmp_alg_rules(flt_rule_v6, IPACM_Wan::num_v6_flt_rule, IPA_IP_v6))
{
@@ -4562,104 +4559,6 @@ fail:
return res;
}
-int IPACM_Wan::add_tcpv6_filtering_rule(struct ipa_flt_rule_add *rules, int rule_offset)
-{
- struct ipa_ioc_get_rt_tbl_indx rt_tbl_idx;
- struct ipa_flt_rule_add flt_rule_entry;
- struct ipa_ioc_generate_flt_eq flt_eq;
- int res = IPACM_SUCCESS;
-
- if(rules == NULL)
- {
- IPACMERR("No filtering table available.\n");
- return IPACM_FAILURE;
- }
- if(rx_prop == NULL)
- {
- IPACMERR("No tx property.\n");
- return IPACM_FAILURE;
- }
-
- memset(&rt_tbl_idx, 0, sizeof(rt_tbl_idx));
- strlcpy(rt_tbl_idx.name, IPACM_Iface::ipacmcfg->rt_tbl_wan_dl.name, IPA_RESOURCE_NAME_MAX);
- rt_tbl_idx.name[IPA_RESOURCE_NAME_MAX-1] = '\0';
- rt_tbl_idx.ip = IPA_IP_v6;
- if(0 != ioctl(m_fd_ipa, IPA_IOC_QUERY_RT_TBL_INDEX, &rt_tbl_idx))
- {
- IPACMERR("Failed to get routing table index from name\n");
- res = IPACM_FAILURE;
- goto fail;
- }
-
- IPACMDBG_H("Routing table %s has index %d\n", rt_tbl_idx.name, rt_tbl_idx.idx);
- memset(&flt_rule_entry, 0, sizeof(struct ipa_flt_rule_add));
-
- flt_rule_entry.at_rear = true;
- flt_rule_entry.flt_rule_hdl = -1;
- flt_rule_entry.status = -1;
-
- flt_rule_entry.rule.retain_hdr = 1;
- flt_rule_entry.rule.to_uc = 0;
- flt_rule_entry.rule.eq_attrib_type = 1;
- flt_rule_entry.rule.action = IPA_PASS_TO_ROUTING;
- flt_rule_entry.rule.rt_tbl_idx = rt_tbl_idx.idx;
-
-#ifdef FEATURE_IPA_ANDROID
- IPACMDBG_H("Add TCP ctrl rules: total num %d\n", IPA_V2_NUM_TCP_WAN_FILTER_RULE_IPV6);
-#endif
- memcpy(&flt_rule_entry.rule.attrib,
- &rx_prop->rx[0].attrib,
- sizeof(flt_rule_entry.rule.attrib));
- memset(&flt_eq, 0, sizeof(flt_eq));
- memcpy(&flt_eq.attrib, &flt_rule_entry.rule.attrib, sizeof(flt_eq.attrib));
- flt_eq.ip = IPA_IP_v6;
- if(0 != ioctl(m_fd_ipa, IPA_IOC_GENERATE_FLT_EQ, &flt_eq))
- {
- IPACMERR("Failed to get eq_attrib\n");
- res = IPACM_FAILURE;
- goto fail;
- }
-
- memcpy(&flt_rule_entry.rule.eq_attrib,
- &flt_eq.eq_attrib,
- sizeof(flt_rule_entry.rule.eq_attrib));
-
- flt_rule_entry.rule.eq_attrib.rule_eq_bitmap |= (1<<1);
- flt_rule_entry.rule.eq_attrib.protocol_eq_present = 1;
- flt_rule_entry.rule.eq_attrib.protocol_eq = IPACM_FIREWALL_IPPROTO_TCP;
-
-#ifdef FEATURE_IPA_V3
- flt_rule_entry.rule.eq_attrib.rule_eq_bitmap |= (1<<7);
-#else
- flt_rule_entry.rule.eq_attrib.rule_eq_bitmap |= (1<<8);
-#endif
- flt_rule_entry.rule.eq_attrib.num_ihl_offset_meq_32 = 1;
- flt_rule_entry.rule.eq_attrib.ihl_offset_meq_32[0].offset = 12;
-
- /* add TCP FIN rule*/
- flt_rule_entry.rule.eq_attrib.ihl_offset_meq_32[0].value = (((uint32_t)1)<<TCP_FIN_SHIFT);
- flt_rule_entry.rule.eq_attrib.ihl_offset_meq_32[0].mask = (((uint32_t)1)<<TCP_FIN_SHIFT);
- memcpy(&(rules[rule_offset]), &flt_rule_entry, sizeof(struct ipa_flt_rule_add));
-
- /* add TCP SYN rule*/
- flt_rule_entry.rule.eq_attrib.ihl_offset_meq_32[0].value = (((uint32_t)1)<<TCP_SYN_SHIFT);
- flt_rule_entry.rule.eq_attrib.ihl_offset_meq_32[0].mask = (((uint32_t)1)<<TCP_SYN_SHIFT);
- memcpy(&(rules[rule_offset + 1]), &flt_rule_entry, sizeof(struct ipa_flt_rule_add));
-
- /* add TCP RST rule*/
- flt_rule_entry.rule.eq_attrib.ihl_offset_meq_32[0].value = (((uint32_t)1)<<TCP_RST_SHIFT);
- flt_rule_entry.rule.eq_attrib.ihl_offset_meq_32[0].mask = (((uint32_t)1)<<TCP_RST_SHIFT);
- memcpy(&(rules[rule_offset + 2]), &flt_rule_entry, sizeof(struct ipa_flt_rule_add));
-
-#ifdef FEATURE_IPA_ANDROID
- IPACM_Wan::num_v6_flt_rule += IPA_V2_NUM_TCP_WAN_FILTER_RULE_IPV6;
- IPACMDBG_H("Constructed %d ICMP filtering rules for ip type %d\n", IPA_V2_NUM_TCP_WAN_FILTER_RULE_IPV6, IPA_IP_v6);
-#endif
-
-fail:
- return res;
-}
-
int IPACM_Wan::del_wan_firewall_rule(ipa_ip_type iptype)
{
if(iptype == IPA_IP_v4)