summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adisumarta <madisuma@codeaurora.org>2021-02-11 20:08:27 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2021-07-02 05:11:18 -0700
commit75692cb5d0722d10f438c88bee79fcab67335269 (patch)
treeaba2792d0c57f680251ba12f0fe3b00015b479dd
parent38be6c65091239160b529eb804aba3474b36cd74 (diff)
downloadipacfg-mgr-75692cb5d0722d10f438c88bee79fcab67335269.tar.gz
ipacm: Add checks to prevent installing duplicate MHI exception rules
Check the MHI exception rule handles before installing the rules. If they are nonzero, they they should be deleted first before installing again. Change-Id: I59ad4381ed3424677467efa094ecce61219d69e6
-rw-r--r--ipacm/src/IPACM_Wan.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/ipacm/src/IPACM_Wan.cpp b/ipacm/src/IPACM_Wan.cpp
index f17eb03..a36fa4a 100644
--- a/ipacm/src/IPACM_Wan.cpp
+++ b/ipacm/src/IPACM_Wan.cpp
@@ -134,6 +134,10 @@ IPACM_Wan::IPACM_Wan(int iface_index,
is_ipv6_frag_firewall_flt_rule_installed = false;
ipv6_frag_firewall_flt_rule_hdl = 0;
+ icmpv6_exception_hdl = 0;
+ tcp_fin_hdl = 0;
+ tcp_rst_hdl = 0;
+
mtu_v4 = DEFAULT_MTU_SIZE;
mtu_v4_set = false;
mtu_v6 = DEFAULT_MTU_SIZE;
@@ -7580,6 +7584,13 @@ int IPACM_Wan::add_offload_frag_rule()
uint8_t mux_id;
ipa_ioc_add_flt_rule *pFilteringTable = NULL;
+ /* Return if rules are there */
+ if (mhi_dl_v4_frag_hdl)
+ {
+ IPACMERR("frag rule have not been deleted. Don't install again\n");
+ return IPACM_FAILURE;
+ }
+
mux_id = ext_prop->ext[0].mux_id;
/* contruct filter rules to pcie modem */
struct ipa_flt_rule_add flt_rule_entry;
@@ -7721,6 +7732,13 @@ int IPACM_Wan::add_icmpv6_exception_rule()
uint8_t mux_id;
ipa_ioc_add_flt_rule *pFilteringTable = NULL;
+ /* Return if rules are there */
+ if (icmpv6_exception_hdl)
+ {
+ IPACMERR("icmpv6 rule have not been deleted. Don't install again\n");
+ return IPACM_FAILURE;
+ }
+
mux_id = ext_prop->ext[0].mux_id;
/* contruct filter rules to pcie modem */
struct ipa_flt_rule_add flt_rule_entry;
@@ -7858,6 +7876,13 @@ int IPACM_Wan::add_tcp_fin_rst_exception_rule()
uint8_t mux_id;
ipa_ioc_add_flt_rule *pFilteringTable = NULL;
+ /* Return if rules are there */
+ if (tcp_fin_hdl || tcp_rst_hdl)
+ {
+ IPACMERR("tcp RST/FIN rules have not been deleted. Don't install again\n");
+ return IPACM_FAILURE;
+ }
+
mux_id = ext_prop->ext[0].mux_id;
/* contruct filter rules to pcie modem */
struct ipa_flt_rule_add flt_rule_entry;