IPACM: Fix the filter index while deleting the rule
This change fixes the incorrect filter index counter
while deleting the IPv6 filetring rules while switching
from AP mode to AP-STA mode and vice-versa.
Change-Id: I231c90b1f4a8ab468c44323dd36276be71c5abf2
diff --git a/ipacm/src/IPACM_Wan.cpp b/ipacm/src/IPACM_Wan.cpp
index 154c8dc..0de5b6c 100644
--- a/ipacm/src/IPACM_Wan.cpp
+++ b/ipacm/src/IPACM_Wan.cpp
@@ -1652,7 +1652,9 @@
return IPACM_FAILURE;
}
- if(iptype == IPA_IP_v6 && firewall_config.firewall_enable == true)
+ if(iptype == IPA_IP_v6 &&
+ firewall_config.firewall_enable == true &&
+ check_dft_firewall_rules_attr_mask(&firewall_config))
{
m_pFilteringTable->commit = 1;
m_pFilteringTable->ep = rx_prop->rx[0].src_pipe;
@@ -3546,11 +3548,17 @@
return IPACM_FAILURE;
}
IPACM_Iface::ipacmcfg->decreaseFltRuleCount(rx_prop->rx[0].src_pipe, IPA_IP_v6, 1);
- if (m_filtering.DeleteFilteringHdls(&ipv6_frag_firewall_flt_rule_hdl, IPA_IP_v6, 1) == false)
+
+ if (firewall_config.firewall_enable == true &&
+ check_dft_firewall_rules_attr_mask(&firewall_config))
{
- IPACMERR("Error deleting IPv6 frag filtering rules.\n");
+ if (m_filtering.DeleteFilteringHdls(&ipv6_frag_firewall_flt_rule_hdl, IPA_IP_v6, 1) == false)
+ {
+ IPACMERR("Error deleting IPv6 frag filtering rules.\n");
+ return IPACM_FAILURE;
+ }
+ IPACM_Iface::ipacmcfg->decreaseFltRuleCount(rx_prop->rx[0].src_pipe, IPA_IP_v6, 1);
}
- IPACM_Iface::ipacmcfg->decreaseFltRuleCount(rx_prop->rx[0].src_pipe, IPA_IP_v6, 1);
num_firewall_v6 = 0;
}
diff --git a/ipacm/src/IPACM_Wlan.cpp b/ipacm/src/IPACM_Wlan.cpp
index a1a103e..38f4308 100644
--- a/ipacm/src/IPACM_Wlan.cpp
+++ b/ipacm/src/IPACM_Wlan.cpp
@@ -479,7 +479,7 @@
IPACMDBG_H("Received IPA_WAN_V6_DOWN in WLAN-instance and need clean up client IPv6 address \n");
/* reset wifi-client ipv6 rt-rules */
handle_wlan_client_reset_rt(IPA_IP_v6);
- IPACMDBG_H("Backhaul is sta mode?%d\n", data_wan->is_sta);
+ IPACMDBG_H("Backhaul is sta mode ? %d\n", data_wan->is_sta);
if(data_wan->is_sta == false && wlan_ap_index > 0)
{
IPACMDBG_H("This is not the first AP instance and not STA mode, ignore WAN_DOWN event.\n");