diff options
author | Bruno Martins <bgcngm@gmail.com> | 2018-09-07 17:34:01 +0100 |
---|---|---|
committer | Davide Garberi <dade.garberi@gmail.com> | 2018-09-13 15:22:10 +0200 |
commit | 9b3b1b12a25947f1d09e445e96cb66e5190275ac (patch) | |
tree | 03b1e1fa70f82097e81f4a271645dee3391767d7 /data-ipa-cfg-mgr/ipacm/src/IPACM_Xml.cpp | |
parent | 0bde58e2bc8440f4d98f0d383dad26f450ad8fd8 (diff) |
msm8996-common: Update IPACM for P release
* Tag: LA.UM.7.5.r1-02200-8x96.0
Change-Id: Id7f0760c0dd1e5476db88d6089d0084eae127a49
Signed-off-by: Davide Garberi <dade.garberi@gmail.com>
Diffstat (limited to 'data-ipa-cfg-mgr/ipacm/src/IPACM_Xml.cpp')
-rw-r--r-- | data-ipa-cfg-mgr/ipacm/src/IPACM_Xml.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/data-ipa-cfg-mgr/ipacm/src/IPACM_Xml.cpp b/data-ipa-cfg-mgr/ipacm/src/IPACM_Xml.cpp index b81856a..4451906 100644 --- a/data-ipa-cfg-mgr/ipacm/src/IPACM_Xml.cpp +++ b/data-ipa-cfg-mgr/ipacm/src/IPACM_Xml.cpp @@ -665,6 +665,9 @@ static int IPACM_firewall_xml_parse_tree memcpy(content_buf, (void *)content, str_size); config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v4.tos = atoi(content_buf); + // Here we do not know if it is TOS with mask or not, so we put at both places + config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.tos_value + = atoi(content_buf); IPACMDBG_H("\n IPV4 TOS val is %d \n", config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v4.tos); } @@ -674,13 +677,25 @@ static int IPACM_firewall_xml_parse_tree content = IPACM_read_content_element(xml_node); if (content) { + uint8_t mask; + str_size = strlen(content); memset(content_buf, 0, sizeof(content_buf)); memcpy(content_buf, (void *)content, str_size); - config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v4.tos - &= atoi(content_buf); - IPACMDBG_H("\n IPv4 TOS mask is %d \n", - config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v4.tos); + mask = atoi(content_buf); + IPACMDBG_H("\n IPv4 TOS mask is %u \n", mask); + if (mask != 0xFF) { + // TOS attribute cannot be used + config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.u.v4.tos = 0; + config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.tos_mask = mask; + + config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask |= + IPA_FLT_TOS_MASKED; + config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.attrib_mask &= + ~IPA_FLT_TOS; + } else { + config->extd_firewall_entries[config->num_extd_firewall_entries - 1].attrib.tos_value = 0; + } } } else if (0 == IPACM_util_icmp_string((char*)xml_node->name, IPV4NextHeaderProtocol_TAG)) |