IPACM: fix v6 DL traffic going through SW path
Change IPA_FLT_PROTOCOL to IPA_FLT_NEXT_HDR in IPv6 filtering
rule construction to solve the problem of ioctl ioctl
IPA_IOC_GENERATE_FLT_EQ failure so that WAN DL IPv6
default filtering rule can be added.
Change-Id: I01daa1b3e57d8c33f834e327268934e4345d59ab
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
diff --git a/ipacm/src/IPACM_Wan.cpp b/ipacm/src/IPACM_Wan.cpp
index b72aaf6..560a604 100644
--- a/ipacm/src/IPACM_Wan.cpp
+++ b/ipacm/src/IPACM_Wan.cpp
@@ -1971,7 +1971,7 @@
IPACMDBG("Routing table %s has index %d\n", rt_tbl_idx.name, rt_tbl_idx.idx);
memcpy(&flt_rule_entry.rule.attrib,
- &rx_prop->rx[0].attrib,
+ &rx_prop->rx[1].attrib,
sizeof(struct ipa_rule_attrib));
flt_rule_entry.rule.attrib.attrib_mask |= IPA_FLT_DST_ADDR;
flt_rule_entry.rule.attrib.u.v6.dst_addr_mask[0] = 0x00000000;
@@ -2250,9 +2250,9 @@
/* Configuring ICMP filtering rule */
memcpy(&flt_rule_entry.rule.attrib,
- &rx_prop->rx[0].attrib,
+ &rx_prop->rx[1].attrib,
sizeof(flt_rule_entry.rule.attrib));
- flt_rule_entry.rule.attrib.attrib_mask |= IPA_FLT_PROTOCOL;
+ flt_rule_entry.rule.attrib.attrib_mask |= IPA_FLT_NEXT_HDR;
flt_rule_entry.rule.attrib.u.v6.next_hdr = (uint8_t)IPACM_FIREWALL_IPPROTO_ICMP6;
memset(&flt_eq, 0, sizeof(flt_eq));
@@ -2313,6 +2313,8 @@
return ret;
}
+ IPACMDBG("Wan interface has %d tx props, %d rx props and %d ext props\n", iface_query->num_tx_props, iface_query->num_rx_props, iface_query->num_ext_props);
+
for (cnt = 0; cnt < ext_prop->num_ext_props; cnt++)
{
IPACMDBG("Ex(%d): ip-type: %d, mux_id: %d, flt_action: %d\n, rt_tbl_idx: %d, flt_hdr: %d \n",
diff --git a/ipacm/src/IPACM_Xml.cpp b/ipacm/src/IPACM_Xml.cpp
index 27474d3..6da2106 100644
--- a/ipacm/src/IPACM_Xml.cpp
+++ b/ipacm/src/IPACM_Xml.cpp
@@ -370,7 +370,9 @@
ret_val = IPACM_firewall_xml_parse_tree(root, config);
if (ret_val != IPACM_SUCCESS)
+ {
IPACMDBG("IPACM_xml_parse: ipacm_firewall_xml_parse_tree returned parse error!\n");
+ }
/* free the tree */
xmlFreeDoc(doc);