IPACM: Fix for LAN ICMP and ICMPv6 traffic to take HW path
LAN ICMP/ICMPv6 traffic takes IPA HW path. For other
traffic it takes SW path.
Change-Id: I6e3a1414023e2450500cd5fcdae4b9d3f13f6e34
diff --git a/ipacm/src/IPACM_Lan.cpp b/ipacm/src/IPACM_Lan.cpp
index fa8c1a1..823879b 100644
--- a/ipacm/src/IPACM_Lan.cpp
+++ b/ipacm/src/IPACM_Lan.cpp
@@ -437,20 +437,20 @@
|| ((data->iptype==IPA_IP_v6) && (num_dft_rt_v6!=MAX_DEFAULT_v6_ROUTE_RULES)))
{
IPACMDBG_H("Got IPA_ADDR_ADD_EVENT ip-family:%d, v6 num %d: \n",data->iptype,num_dft_rt_v6);
+ if(handle_addr_evt(data) == IPACM_FAILURE)
+ {
+ return;
+ }
/* ADD ipv4 icmp rule */
if (data->iptype == IPA_IP_v4)
{
install_ipv4_icmp_flt_rule();
}
/* ADD ipv6 icmp rule */
- if ((num_dft_rt_v6 == 0) && (data->iptype == IPA_IP_v6))
+ if ((num_dft_rt_v6 == 1) && (data->iptype == IPA_IP_v6))
{
install_ipv6_icmp_flt_rule();
}
- if(handle_addr_evt(data) == IPACM_FAILURE)
- {
- return;
- }
handle_private_subnet(data->iptype);
if (IPACM_Wan::isWanUP())
@@ -2878,7 +2878,7 @@
flt_rule_entry.rule.eq_attrib.metadata_meq32.offset = 0;
flt_rule_entry.rule.eq_attrib.metadata_meq32.value = (value & 0xFF) << 16;
flt_rule_entry.rule.eq_attrib.metadata_meq32.mask = 0x00FF0000;
- IPACMDBG_H("xlat meta-data is modified fur rult: %d has index %d with xlat_mux_id: %d\n",
+ IPACMDBG_H("xlat meta-data is modified for rule: %d has index %d with xlat_mux_id: %d\n",
cnt, index, xlat_mux_id);
}
memcpy(&pFilteringTable->rules[cnt], &flt_rule_entry, sizeof(flt_rule_entry));
@@ -4168,7 +4168,7 @@
flt_rule_entry.rule.retain_hdr = 1;
flt_rule_entry.rule.to_uc = 0;
flt_rule_entry.rule.eq_attrib_type = 0;
- flt_rule_entry.at_rear = false;
+ flt_rule_entry.at_rear = true;
flt_rule_entry.flt_rule_hdl = -1;
flt_rule_entry.status = -1;
flt_rule_entry.rule.action = IPA_PASS_TO_EXCEPTION;
@@ -4569,7 +4569,7 @@
flt_rule_entry.rule.retain_hdr = 1;
flt_rule_entry.rule.to_uc = 0;
flt_rule_entry.rule.eq_attrib_type = 0;
- flt_rule_entry.at_rear = false;
+ flt_rule_entry.at_rear = true;
flt_rule_entry.flt_rule_hdl = -1;
flt_rule_entry.status = -1;
flt_rule_entry.rule.action = IPA_PASS_TO_EXCEPTION;
diff --git a/ipacm/src/IPACM_Wlan.cpp b/ipacm/src/IPACM_Wlan.cpp
index ef58227..fa3b6af 100644
--- a/ipacm/src/IPACM_Wlan.cpp
+++ b/ipacm/src/IPACM_Wlan.cpp
@@ -320,17 +320,17 @@
info->ipv4_addr, info->addr_mask);
IPACM_EvtDispatcher::PostEvt(&evt_data);
}
+ if(handle_addr_evt(data) == IPACM_FAILURE)
+ {
+ return;
+ }
if ((data->iptype == IPA_IP_v4) && (wlan_ap_index == 0))
{
IPACM_Lan::install_ipv4_icmp_flt_rule();
}
- if ((num_dft_rt_v6 == 0) && (data->iptype == IPA_IP_v6) && (wlan_ap_index == 0))
+ if ((num_dft_rt_v6 == 1) && (data->iptype == IPA_IP_v6) && (wlan_ap_index == 0))
{
- install_ipv6_icmp_flt_rule();
- }
- if(handle_addr_evt(data) == IPACM_FAILURE)
- {
- return;
+ install_ipv6_icmp_flt_rule();
}
#ifdef FEATURE_IPA_ANDROID