Merge tag 'LA.UM.8.1.r1-14300-sm8150.0' of https://source.codeaurora.org/quic/la/platform/vendor/qcom-opensource/data-ipa-cfg-mgr into lineage-17.1
"LA.UM.8.1.r1-14300-sm8150.0"
Change-Id: I5776321fbf8638f27673fe433e95bd9767c1d067
diff --git a/ipacm/inc/IPACM_Config.h b/ipacm/inc/IPACM_Config.h
index 9230f7d..2792f62 100644
--- a/ipacm/inc/IPACM_Config.h
+++ b/ipacm/inc/IPACM_Config.h
@@ -94,7 +94,7 @@
ipacm_alg *alg_table;
/* Store private subnet configuration from XML file */
- ipa_private_subnet private_subnet_table[IPA_MAX_PRIVATE_SUBNET_ENTRIES];
+ ipa_private_subnet private_subnet_table[IPA_MAX_PRIVATE_SUBNET_ENTRIES + IPA_MAX_MTU_ENTRIES];
/* Store the non nat iface names */
NatIfaces *pNatIfaces;
diff --git a/ipacm/inc/IPACM_Defs.h b/ipacm/inc/IPACM_Defs.h
index 65d5ce4..b1daf35 100644
--- a/ipacm/inc/IPACM_Defs.h
+++ b/ipacm/inc/IPACM_Defs.h
@@ -77,6 +77,7 @@
#define IPA_MAX_IFACE_ENTRIES 20
#define IPA_MAX_PRIVATE_SUBNET_ENTRIES 3
+#define IPA_MAX_MTU_ENTRIES 3
#define IPA_MAX_ALG_ENTRIES 20
#define IPA_MAX_RM_ENTRY 6
@@ -106,6 +107,7 @@
#define TCP_SYN_SHIFT 17
#define TCP_RST_SHIFT 18
#define NUM_IPV6_PREFIX_FLT_RULE 1
+#define NUM_IPV6_PREFIX_MTU_RULE 1
/*---------------------------------------------------------------------------
Return values indicating error status
@@ -124,6 +126,7 @@
#define IPA_MAC_ADDR_SIZE 6
#define IPA_MAX_NUM_SW_PDNS 15
+#define DEFAULT_MTU_SIZE 1500
/*===========================================================================
GLOBAL DEFINITIONS AND DECLARATIONS
===========================================================================*/
diff --git a/ipacm/inc/IPACM_Lan.h b/ipacm/inc/IPACM_Lan.h
index bf815c5..605edb5 100644
--- a/ipacm/inc/IPACM_Lan.h
+++ b/ipacm/inc/IPACM_Lan.h
@@ -113,7 +113,7 @@
uint32_t lan_wan_fl_rule_hdl[IPA_WAN_DEFAULT_FILTER_RULE_HANDLES];
/* store private-subnet filter rule handlers */
- uint32_t private_fl_rule_hdl[IPA_MAX_PRIVATE_SUBNET_ENTRIES];
+ uint32_t private_fl_rule_hdl[IPA_MAX_PRIVATE_SUBNET_ENTRIES + IPA_MAX_MTU_ENTRIES];
/* LAN-iface's callback function */
void event_callback(ipa_cm_event_id event, void *data);
@@ -258,7 +258,7 @@
uint32_t ipv4_icmp_flt_rule_hdl[NUM_IPV4_ICMP_FLT_RULE];
- uint32_t ipv6_prefix_flt_rule_hdl[NUM_IPV6_PREFIX_FLT_RULE];
+ uint32_t ipv6_prefix_flt_rule_hdl[NUM_IPV6_PREFIX_FLT_RULE + NUM_IPV6_PREFIX_MTU_RULE];
uint32_t ipv6_icmp_flt_rule_hdl[NUM_IPV6_ICMP_FLT_RULE];
int num_wan_ul_fl_rule_v4;
@@ -464,6 +464,8 @@
/* for pcie modem */
virtual int add_connection(int client_index, int v6_num);
virtual int del_connection(int client_index, int v6_num);
+
+ int construct_mtu_rule(struct ipa_flt_rule *rule, enum ipa_ip_type iptype, uint16_t mtu);
};
#endif /* IPACM_LAN_H */
diff --git a/ipacm/inc/IPACM_Wan.h b/ipacm/inc/IPACM_Wan.h
index 9f1001a..31949c5 100644
--- a/ipacm/inc/IPACM_Wan.h
+++ b/ipacm/inc/IPACM_Wan.h
@@ -105,6 +105,8 @@
static bool wan_up;
static bool wan_up_v6;
static uint8_t xlat_mux_id;
+ static uint16_t mtu_default_wan;
+ uint16_t mtu_size;
/* IPACM interface name */
static char wan_up_dev_name[IF_NAME_LEN];
static uint32_t curr_wan_ip;
@@ -137,6 +139,26 @@
#endif
}
+ static uint16_t queryMTU(int ipa_if_num_tether, enum ipa_ip_type iptype)
+ {
+ if (iptype == IPA_IP_v4)
+ {
+ if (isWanUP(ipa_if_num_tether))
+ {
+ return mtu_default_wan;
+ }
+ }
+ else if (iptype == IPA_IP_v6)
+ {
+ if (isWanUP_V6(ipa_if_num_tether))
+ {
+ return mtu_default_wan;
+
+ }
+ }
+ return DEFAULT_MTU_SIZE;
+ }
+
static bool isWanUP_V6(int ipa_if_num_tether)
{
#ifdef FEATURE_IPA_ANDROID
@@ -253,9 +275,16 @@
return curr_wan_ip;
}
- static bool getXlat_Mux_Id()
+ static int getXlat_Mux_Id()
{
- return xlat_mux_id;
+ if (is_xlat)
+ {
+ IPACMDBG_H("xlat_mux_id: %d\n", xlat_mux_id);
+ return xlat_mux_id;
+ } else {
+ IPACMDBG_H("no xlat return invalid mux-id: 0\n");
+ return 0;
+ }
}
static void clearExtProp()
@@ -646,6 +675,9 @@
int add_tcp_fin_rst_exception_rule();
int delete_tcp_fin_rst_exception_rule();
+
+ /* Query mtu size */
+ int query_mtu_size();
};
#endif /* IPACM_WAN_H */
diff --git a/ipacm/src/IPACM_Conntrack_NATApp.cpp b/ipacm/src/IPACM_Conntrack_NATApp.cpp
index c1f47e1..0cf101f 100644
--- a/ipacm/src/IPACM_Conntrack_NATApp.cpp
+++ b/ipacm/src/IPACM_Conntrack_NATApp.cpp
@@ -195,6 +195,12 @@
}
}
+ /* configure NAT initialization paramater */
+ pub_ip_addr = pub_ip;
+ pub_mux_id = mux_id;
+ IPACMDBG(" Set pub_mux_id: %d\t", pub_mux_id);
+
+
/* Add back the cached NAT-entry */
if (pub_ip == pub_ip_addr_pre)
{
@@ -222,6 +228,8 @@
/* send connections info to pcie modem only with DL direction */
if ((CtList->backhaul_mode == Q6_MHI_WAN) && (cache[cnt].dst_nat == true || cache[cnt].protocol == IPPROTO_TCP))
{
+ /* propagate pub_ip info */
+ cache[cnt].public_ip = pub_ip;
ret = AddConnection(&cache[cnt]);
if(ret > 0)
{
@@ -246,9 +254,6 @@
}
}
- pub_ip_addr = pub_ip;
- pub_mux_id = mux_id;
- IPACMDBG(" Set pub_mux_id: %d\t", pub_mux_id);
return 0;
}
diff --git a/ipacm/src/IPACM_Iface.cpp b/ipacm/src/IPACM_Iface.cpp
index ec4a9ea..efa941c 100644
--- a/ipacm/src/IPACM_Iface.cpp
+++ b/ipacm/src/IPACM_Iface.cpp
@@ -938,15 +938,12 @@
memcpy(&(m_pFilteringTable->rules[3]), &flt_rule_entry, sizeof(struct ipa_flt_rule_add));
#ifdef FEATURE_IPA_ANDROID
- /* Add the ipv6 tcp fragment filtering rule. */
+ /* Add the ipv6 tcp/udp fragment filtering rule for MTU */
- IPACMDBG_H("Adding IPv6 TCP fragment filter rule\n");
+ IPACMDBG_H("Adding IPv6 fragment filter rule\n");
flt_rule_entry.rule.attrib.attrib_mask &= ~((uint32_t)IPA_FLT_DST_ADDR);
- flt_rule_entry.rule.attrib.attrib_mask |= IPA_FLT_NEXT_HDR;
- flt_rule_entry.rule.attrib.u.v6.next_hdr = IPACM_FIREWALL_IPPROTO_TCP;
-
flt_rule_entry.rule.attrib.attrib_mask |= IPA_FLT_FRAGMENT;
memcpy(&(m_pFilteringTable->rules[4]), &flt_rule_entry,
diff --git a/ipacm/src/IPACM_Lan.cpp b/ipacm/src/IPACM_Lan.cpp
index fff1783..ebaca87 100644
--- a/ipacm/src/IPACM_Lan.cpp
+++ b/ipacm/src/IPACM_Lan.cpp
@@ -129,8 +129,8 @@
memset(ipv4_icmp_flt_rule_hdl, 0, NUM_IPV4_ICMP_FLT_RULE * sizeof(uint32_t));
- memset(private_fl_rule_hdl, 0, IPA_MAX_PRIVATE_SUBNET_ENTRIES * sizeof(uint32_t));
- memset(ipv6_prefix_flt_rule_hdl, 0, NUM_IPV6_PREFIX_FLT_RULE * sizeof(uint32_t));
+ memset(private_fl_rule_hdl, 0, (IPA_MAX_PRIVATE_SUBNET_ENTRIES + IPA_MAX_MTU_ENTRIES) * sizeof(uint32_t));
+ memset(ipv6_prefix_flt_rule_hdl, 0, (NUM_IPV6_PREFIX_FLT_RULE + NUM_IPV6_PREFIX_MTU_RULE) * sizeof(uint32_t));
memset(ipv6_icmp_flt_rule_hdl, 0, NUM_IPV6_ICMP_FLT_RULE * sizeof(uint32_t));
memset(ipv6_prefix, 0, sizeof(ipv6_prefix));
@@ -751,15 +751,19 @@
{
IPACMDBG_H("Received IPA_DOWNSTREAM_ADD event.\n");
#ifdef FEATURE_IPA_ANDROID
- /* indicate v4-offload */
- IPACM_OffloadManager::num_offload_v4_tethered_iface++;
-
- /* xlat not support for 2st tethered iface */
- if (IPACM_Wan::isXlat() && (data->prefix.iptype == IPA_IP_v4) && (IPACM_OffloadManager::num_offload_v4_tethered_iface > 1))
+ if (IPACM_Wan::isXlat() && (data->prefix.iptype == IPA_IP_v4))
{
- IPACMDBG_H("Not support 2st downstream iface %s for xlat, cur: %d\n", dev_name,
- IPACM_OffloadManager::num_offload_v4_tethered_iface);
- return;
+ /* indicate v4-offload */
+ IPACM_OffloadManager::num_offload_v4_tethered_iface++;
+ IPACMDBG_H("in xlat: update num_offload_v4_tethered_iface %d\n", IPACM_OffloadManager::num_offload_v4_tethered_iface);
+
+ /* xlat not support for 2st tethered iface */
+ if (IPACM_OffloadManager::num_offload_v4_tethered_iface > 1)
+ {
+ IPACMDBG_H("Not support 2st downstream iface %s for xlat, cur: %d\n", dev_name,
+ IPACM_OffloadManager::num_offload_v4_tethered_iface);
+ return;
+ }
}
IPACMDBG_H(" support downstream iface %s, cur %d\n", dev_name,
@@ -877,6 +881,11 @@
{
memcpy(ipv6_prefix, data_wan->ipv6_prefix, sizeof(ipv6_prefix));
install_ipv6_prefix_flt_rule(data_wan->ipv6_prefix);
+
+ /* MTU might have changed. Need to update ipv4 MTU rule if up */
+ if (IPACM_Wan::isWanUP(ipa_if_num))
+ handle_private_subnet_android(IPA_IP_v4);
+
if (data_wan->backhaul_type == Q6_WAN)
{
ext_prop = IPACM_Iface::ipacmcfg->GetExtProp(IPA_IP_v6);
@@ -1302,6 +1311,9 @@
sta_ul_v4_set = false;
}
+ /* clean MTU rules if needed */
+ handle_private_subnet_android(IPA_IP_v4);
+
close(fd);
return IPACM_SUCCESS;
}
@@ -1640,6 +1652,18 @@
if(ip_type == IPA_IP_v4)
{
+ /* add MTU rules for ipv4 */
+ handle_private_subnet_android(IPA_IP_v4);
+
+ /* Update ipv6 MTU here if WAN_v6 is up and filter rules were installed */
+ if (IPACM_Wan::isWanUP_V6(ipa_if_num))
+ {
+ if (ipv6_prefix_flt_rule_hdl[0] && ipv6_prefix_flt_rule_hdl[1] ) {
+ delete_ipv6_prefix_flt_rule();
+ install_ipv6_prefix_flt_rule(IPACM_Wan::backhaul_ipv6_prefix);
+ }
+ }
+
if(sta_ul_v4_set == true)
{
IPACMDBG_H("Filetring rule for IPV4 of STA mode is already configured, sta_ul_v4_set: %d\n",sta_ul_v4_set);
@@ -1882,6 +1906,19 @@
ret = handle_uplink_filter_rule(ext_prop, iptype, xlat_mux_id);
modem_ul_v6_set = true;
} else if (iptype ==IPA_IP_v4 && modem_ul_v4_set == false) {
+ /* add MTU rules for ipv4 */
+ handle_private_subnet_android(IPA_IP_v4);
+
+ /* Update ipv6 MTU here if WAN_v6 is up and filter rules were installed */
+ if (IPACM_Wan::isWanUP_V6(ipa_if_num))
+ {
+ if (ipv6_prefix_flt_rule_hdl[0] && ipv6_prefix_flt_rule_hdl[1] ) {
+ delete_ipv6_prefix_flt_rule();
+ install_ipv6_prefix_flt_rule(IPACM_Wan::backhaul_ipv6_prefix);
+ }
+ }
+
+ IPACMDBG_H("check getXlat_Mux_Id:%d\n", IPACM_Wan::getXlat_Mux_Id());
IPACMDBG_H("IPA_IP_v4 xlat_mux_id: %d, modem_ul_v4_set %d\n", xlat_mux_id, modem_ul_v4_set);
ret = handle_uplink_filter_rule(ext_prop, iptype, xlat_mux_id);
modem_ul_v4_set = true;
@@ -3054,13 +3091,13 @@
}
#ifdef FEATURE_IPA_ANDROID
- if(m_filtering.DeleteFilteringHdls(private_fl_rule_hdl, IPA_IP_v4, IPA_MAX_PRIVATE_SUBNET_ENTRIES) == false)
+ if(m_filtering.DeleteFilteringHdls(private_fl_rule_hdl, IPA_IP_v4, IPA_MAX_PRIVATE_SUBNET_ENTRIES + IPA_MAX_MTU_ENTRIES) == false)
{
IPACMERR("Error deleting private subnet IPv4 flt rules.\n");
res = IPACM_FAILURE;
goto fail;
}
- IPACM_Iface::ipacmcfg->decreaseFltRuleCount(rx_prop->rx[0].src_pipe, IPA_IP_v4, IPA_MAX_PRIVATE_SUBNET_ENTRIES);
+ IPACM_Iface::ipacmcfg->decreaseFltRuleCount(rx_prop->rx[0].src_pipe, IPA_IP_v4, IPA_MAX_PRIVATE_SUBNET_ENTRIES + IPA_MAX_MTU_ENTRIES);
#else
if (m_filtering.DeleteFilteringHdls(private_fl_rule_hdl, IPA_IP_v4, IPACM_Iface::ipacmcfg->ipa_num_private_subnet) == false)
{
@@ -3279,7 +3316,7 @@
int fd;
int i, index, eq_index;
uint32_t value = 0;
- uint8_t qmap_id;
+ uint8_t qmap_id, xlat_debug;
bool result;
IPACMDBG_H("Set modem UL flt rules\n");
@@ -3338,13 +3375,14 @@
flt_index.retain_header = 0;
flt_index.embedded_call_mux_id_valid = 1;
qmap_id = IPACM_Iface::ipacmcfg->GetQmapId();
+ xlat_debug = IPACM_Wan::getXlat_Mux_Id();
flt_index.embedded_call_mux_id = qmap_id;
#ifndef FEATURE_IPA_V3
- IPACMDBG_H("flt_index: src pipe: %d, num of rules: %d, ebd pipe: %d, mux id: %d\n",
- flt_index.source_pipe_index, flt_index.filter_index_list_len, flt_index.embedded_pipe_index, flt_index.embedded_call_mux_id);
+ IPACMDBG_H("flt_index: src pipe: %d, num of rules: %d, ebd pipe: %d, mux id: %d, xlat_mux id: %d, wan-debug %d\n",
+ flt_index.source_pipe_index, flt_index.filter_index_list_len, flt_index.embedded_pipe_index, flt_index.embedded_call_mux_id, xlat_mux_id, xlat_debug);
#else /* defined (FEATURE_IPA_V3) */
- IPACMDBG_H("flt_index: src pipe: %d, num of rules: %d, ebd pipe: %d, mux id: %d\n",
- flt_index.source_pipe_index, flt_index.rule_id_len, flt_index.embedded_pipe_index, flt_index.embedded_call_mux_id);
+ IPACMDBG_H("flt_index: src pipe: %d, num of rules: %d, ebd pipe: %d, mux id: %d, xlat_mux id: %d, wan-debug %d\n",
+ flt_index.source_pipe_index, flt_index.rule_id_len, flt_index.embedded_pipe_index, flt_index.embedded_call_mux_id, xlat_mux_id, xlat_debug);
#endif
len = sizeof(struct ipa_ioc_add_flt_rule) + prop->num_ext_props * sizeof(struct ipa_flt_rule_add);
pFilteringTable = (struct ipa_ioc_add_flt_rule*)malloc(len);
@@ -3415,6 +3453,13 @@
}
/* Handle XLAT configuration */
+ /* temp wa to reset xlat_mux_id to qmap_id if it's xlat call */
+ if (IPACM_Wan::isXlat() && (iptype == IPA_IP_v4))
+ {
+ IPACMDBG_H("WA to replace xlat_mux_id %d with qmap_id: %d\n", xlat_mux_id, qmap_id);
+ xlat_mux_id = qmap_id;
+ }
+
if ((iptype == IPA_IP_v4) && prop->prop[cnt].is_xlat_rule && (xlat_mux_id != 0))
{
/* fill the value of meta-data */
@@ -4031,7 +4076,7 @@
ipa_ioc_add_flt_rule* pFilteringTable;
bool result;
- len = sizeof(struct ipa_ioc_add_flt_rule) + IPA_MAX_PRIVATE_SUBNET_ENTRIES * sizeof(struct ipa_flt_rule_add);
+ len = sizeof(struct ipa_ioc_add_flt_rule) + (IPA_MAX_PRIVATE_SUBNET_ENTRIES + IPA_MAX_MTU_ENTRIES) * sizeof(struct ipa_flt_rule_add);
pFilteringTable = (struct ipa_ioc_add_flt_rule *)malloc(len);
if (pFilteringTable == NULL)
@@ -4045,7 +4090,7 @@
pFilteringTable->ep = rx_prop->rx[0].src_pipe;
pFilteringTable->global = false;
pFilteringTable->ip = iptype;
- pFilteringTable->num_rules = IPA_MAX_PRIVATE_SUBNET_ENTRIES;
+ pFilteringTable->num_rules = IPA_MAX_PRIVATE_SUBNET_ENTRIES + IPA_MAX_MTU_ENTRIES;
memset(&flt_rule, 0, sizeof(struct ipa_flt_rule_add));
@@ -4068,7 +4113,7 @@
flt_rule.rule.attrib.u.v4.dst_addr_mask = ~0;
flt_rule.rule.attrib.u.v4.dst_addr = ~0;
- for(i=0; i<IPA_MAX_PRIVATE_SUBNET_ENTRIES; i++)
+ for(i=0; i<IPA_MAX_PRIVATE_SUBNET_ENTRIES + IPA_MAX_MTU_ENTRIES; i++)
{
memcpy(&(pFilteringTable->rules[i]), &flt_rule, sizeof(struct ipa_flt_rule_add));
}
@@ -4094,9 +4139,9 @@
}
else
{
- IPACM_Iface::ipacmcfg->increaseFltRuleCount(rx_prop->rx[0].src_pipe, IPA_IP_v4, IPA_MAX_PRIVATE_SUBNET_ENTRIES);
+ IPACM_Iface::ipacmcfg->increaseFltRuleCount(rx_prop->rx[0].src_pipe, IPA_IP_v4, IPA_MAX_PRIVATE_SUBNET_ENTRIES + IPA_MAX_MTU_ENTRIES);
/* copy filter rule hdls */
- for (int i = 0; i < IPA_MAX_PRIVATE_SUBNET_ENTRIES; i++)
+ for (int i = 0; i < IPA_MAX_PRIVATE_SUBNET_ENTRIES + IPA_MAX_MTU_ENTRIES; i++)
{
if (pFilteringTable->rules[i].status == 0)
{
@@ -4122,6 +4167,9 @@
int i, len, res = IPACM_SUCCESS;
struct ipa_flt_rule_mdfy flt_rule;
struct ipa_ioc_mdfy_flt_rule* pFilteringTable;
+ int mtu_rule_cnt = 0;
+ uint16_t mtu[IPA_MAX_PRIVATE_SUBNET_ENTRIES + IPA_MAX_MTU_ENTRIES] = { };
+ int mtu_rule_idx = IPACM_Iface::ipacmcfg->ipa_num_private_subnet;
if (rx_prop == NULL)
{
@@ -4136,12 +4184,24 @@
}
else
{
- for(i=0; i<IPA_MAX_PRIVATE_SUBNET_ENTRIES; i++)
+ for(i=0; i<IPA_MAX_PRIVATE_SUBNET_ENTRIES + IPA_MAX_MTU_ENTRIES; i++)
{
reset_to_dummy_flt_rule(IPA_IP_v4, private_fl_rule_hdl[i]);
}
- len = sizeof(struct ipa_ioc_mdfy_flt_rule) + (IPACM_Iface::ipacmcfg->ipa_num_private_subnet) * sizeof(struct ipa_flt_rule_mdfy);
+ /* check how many MTU rules we need to add */
+ for(i = 0; i < IPACM_Iface::ipacmcfg->ipa_num_private_subnet; i++)
+ {
+ mtu[i] = IPACM_Wan::queryMTU(ipa_if_num, IPA_IP_v4);
+
+ if (mtu[i] > 0)
+ mtu_rule_cnt++;
+ else
+ IPACMDBG_H("MTU is zero\n");
+ }
+ IPACMDBG_H("total %d MTU rules are needed\n", mtu_rule_cnt);
+
+ len = sizeof(struct ipa_ioc_mdfy_flt_rule) + (IPACM_Iface::ipacmcfg->ipa_num_private_subnet + mtu_rule_cnt) * sizeof(struct ipa_flt_rule_mdfy);
pFilteringTable = (struct ipa_ioc_mdfy_flt_rule*)malloc(len);
if (!pFilteringTable)
{
@@ -4152,7 +4212,7 @@
pFilteringTable->commit = 1;
pFilteringTable->ip = iptype;
- pFilteringTable->num_rules = (uint8_t)IPACM_Iface::ipacmcfg->ipa_num_private_subnet;
+ pFilteringTable->num_rules = (uint8_t)IPACM_Iface::ipacmcfg->ipa_num_private_subnet + mtu_rule_cnt;
/* Make LAN-traffic always go A5, use default IPA-RT table */
if (false == m_routing.GetRoutingTable(&IPACM_Iface::ipacmcfg->rt_tbl_default_v4))
@@ -4172,16 +4232,32 @@
flt_rule.rule.rt_tbl_hdl = IPACM_Iface::ipacmcfg->rt_tbl_default_v4.hdl;
IPACMDBG_H("Private filter rule use table: %s\n",IPACM_Iface::ipacmcfg->rt_tbl_default_v4.name);
- memcpy(&flt_rule.rule.attrib, &rx_prop->rx[0].attrib, sizeof(flt_rule.rule.attrib));
- flt_rule.rule.attrib.attrib_mask |= IPA_FLT_DST_ADDR;
-
for (i = 0; i < (IPACM_Iface::ipacmcfg->ipa_num_private_subnet); i++)
{
+ /* add private subnet rule for ipv4 */
+ flt_rule.rule.action = IPA_PASS_TO_ROUTING;
+ flt_rule.rule.eq_attrib_type = 0;
flt_rule.rule_hdl = private_fl_rule_hdl[i];
+ memcpy(&flt_rule.rule.attrib, &rx_prop->rx[0].attrib, sizeof(flt_rule.rule.attrib));
+ flt_rule.rule.attrib.attrib_mask |= IPA_FLT_DST_ADDR;
flt_rule.rule.attrib.u.v4.dst_addr_mask = IPACM_Iface::ipacmcfg->private_subnet_table[i].subnet_mask;
flt_rule.rule.attrib.u.v4.dst_addr = IPACM_Iface::ipacmcfg->private_subnet_table[i].subnet_addr;
memcpy(&(pFilteringTable->rules[i]), &flt_rule, sizeof(struct ipa_flt_rule_mdfy));
IPACMDBG_H(" IPACM private subnet_addr as: 0x%x entry(%d)\n", flt_rule.rule.attrib.u.v4.dst_addr, i);
+
+ /* add corresponding MTU rule for ipv4 */
+ if (mtu[i] > 0)
+ {
+ flt_rule.rule_hdl = private_fl_rule_hdl[mtu_rule_idx + i];
+ memcpy(&flt_rule.rule.attrib, &rx_prop->rx[0].attrib, sizeof(flt_rule.rule.attrib));
+ flt_rule.rule.attrib.u.v4.src_addr_mask = IPACM_Iface::ipacmcfg->private_subnet_table[i].subnet_mask;
+ flt_rule.rule.attrib.u.v4.src_addr = IPACM_Iface::ipacmcfg->private_subnet_table[i].subnet_addr;
+ flt_rule.rule.attrib.attrib_mask |= IPA_FLT_SRC_ADDR;
+ if (construct_mtu_rule(&flt_rule.rule, IPA_IP_v4, mtu[i]))
+ IPACMERR("Failed to modify MTU filtering rule.\n");
+ memcpy(&(pFilteringTable->rules[mtu_rule_idx + i]), &flt_rule, sizeof(struct ipa_flt_rule_mdfy));
+ IPACMDBG_H("Adding MTU rule for private subnet 0x%x.\n", flt_rule.rule.attrib.u.v4.src_addr);
+ }
}
if (false == m_filtering.ModifyFilteringRule(pFilteringTable))
@@ -4212,12 +4288,17 @@
struct ipa_ioc_add_flt_rule* flt_rule;
struct ipa_flt_rule_add flt_rule_entry;
bool result;
+ int rule_cnt = 1;
+
+ uint16_t mtu = IPACM_Wan::queryMTU(ipa_if_num, IPA_IP_v6);
+ if (mtu > 0)
+ rule_cnt ++;
if(rx_prop != NULL)
{
- len = sizeof(struct ipa_ioc_add_flt_rule) + sizeof(struct ipa_flt_rule_add);
+ len = sizeof(struct ipa_ioc_add_flt_rule) + rule_cnt * sizeof(struct ipa_flt_rule_add);
- flt_rule = (struct ipa_ioc_add_flt_rule *)calloc(1, len);
+ flt_rule = (struct ipa_ioc_add_flt_rule *)calloc(rule_cnt, len);
if (!flt_rule)
{
IPACMERR("Error Locate ipa_flt_rule_add memory...\n");
@@ -4228,7 +4309,7 @@
flt_rule->ep = rx_prop->rx[0].src_pipe;
flt_rule->global = false;
flt_rule->ip = IPA_IP_v6;
- flt_rule->num_rules = 1;
+ flt_rule->num_rules = rule_cnt;
memset(&flt_rule_entry, 0, sizeof(struct ipa_flt_rule_add));
@@ -4254,6 +4335,30 @@
flt_rule_entry.rule.attrib.u.v6.dst_addr_mask[3] = 0x0;
memcpy(&(flt_rule->rules[0]), &flt_rule_entry, sizeof(struct ipa_flt_rule_add));
+ memcpy(&flt_rule_entry.rule.attrib, &rx_prop->rx[0].attrib, sizeof(flt_rule_entry.rule.attrib)); // this will remove the IPA_FLT_DST_ADDR
+ flt_rule_entry.rule.attrib.u.v6.src_addr[3] = prefix[0];
+ flt_rule_entry.rule.attrib.u.v6.src_addr[2] = prefix[1];
+ flt_rule_entry.rule.attrib.u.v6.src_addr[1] = 0x0;
+ flt_rule_entry.rule.attrib.u.v6.src_addr[0] = 0x0;
+ flt_rule_entry.rule.attrib.u.v6.src_addr_mask[3] = 0xFFFFFFFF;
+ flt_rule_entry.rule.attrib.u.v6.src_addr_mask[2] = 0xFFFFFFFF;
+ flt_rule_entry.rule.attrib.u.v6.src_addr_mask[1] = 0x0;
+ flt_rule_entry.rule.attrib.u.v6.src_addr_mask[0] = 0x0;
+ flt_rule_entry.rule.attrib.attrib_mask |= IPA_FLT_SRC_ADDR;
+
+ /* Add an MTU rule with every new private prefix */
+ if (mtu > 0)
+ {
+ if (construct_mtu_rule(&flt_rule_entry.rule, IPA_IP_v6, mtu))
+ {
+ IPACMERR("Failed to add MTU filtering rule.\n")
+ }
+ else
+ {
+ memcpy(&(flt_rule->rules[1]), &flt_rule_entry, sizeof(struct ipa_flt_rule_add));
+ }
+ }
+
#ifdef IPA_IOCTL_SET_FNR_COUNTER_INFO
/* use index hw-counter */
if(ipa_if_cate == WLAN_IF && IPACM_Iface::ipacmcfg->hw_fnr_stats_support)
@@ -4275,9 +4380,14 @@
}
else
{
- IPACM_Iface::ipacmcfg->increaseFltRuleCount(rx_prop->rx[0].src_pipe, IPA_IP_v6, 1);
+ IPACM_Iface::ipacmcfg->increaseFltRuleCount(rx_prop->rx[0].src_pipe, IPA_IP_v6, 2);
ipv6_prefix_flt_rule_hdl[0] = flt_rule->rules[0].flt_rule_hdl;
IPACMDBG_H("IPv6 prefix filter rule HDL:0x%x\n", ipv6_prefix_flt_rule_hdl[0]);
+ if (rule_cnt > 1)
+ {
+ ipv6_prefix_flt_rule_hdl[1] = flt_rule->rules[1].flt_rule_hdl;
+ IPACMDBG_H("IPv6 prefix MTU filter rule HDL:0x%x\n", ipv6_prefix_flt_rule_hdl[1]);
+ }
free(flt_rule);
}
}
@@ -4286,12 +4396,12 @@
void IPACM_Lan::delete_ipv6_prefix_flt_rule()
{
- if(m_filtering.DeleteFilteringHdls(ipv6_prefix_flt_rule_hdl, IPA_IP_v6, NUM_IPV6_PREFIX_FLT_RULE) == false)
+ if(m_filtering.DeleteFilteringHdls(ipv6_prefix_flt_rule_hdl, IPA_IP_v6, NUM_IPV6_PREFIX_FLT_RULE + NUM_IPV6_PREFIX_MTU_RULE) == false)
{
- IPACMERR("Failed to delete ipv6 prefix flt rule.\n");
+ IPACMERR("Failed to delete ipv6 prefix flt rules.\n");
return;
}
- IPACM_Iface::ipacmcfg->decreaseFltRuleCount(rx_prop->rx[0].src_pipe, IPA_IP_v6, NUM_IPV6_PREFIX_FLT_RULE);
+ IPACM_Iface::ipacmcfg->decreaseFltRuleCount(rx_prop->rx[0].src_pipe, IPA_IP_v6, NUM_IPV6_PREFIX_FLT_RULE + NUM_IPV6_PREFIX_MTU_RULE);
return;
}
@@ -4719,7 +4829,7 @@
}
}
- ret = ioctl(fd_wwan_ioctl, WAN_IOC_SET_TETHER_CLIENT_PIPE, &tether_client);
+ ret = ioctl(fd_wwan_ioctl, WAN_IOC_SET_TETHER_CLIENT_PIPE, tether_client);
if(ret != 0)
{
IPACMERR("Failed set tether-client-pipe %p with ret %d\n ", &tether_client, ret);
@@ -6323,3 +6433,63 @@
}
return res;
}
+
+int IPACM_Lan::construct_mtu_rule(struct ipa_flt_rule *rule, ipa_ip_type iptype, uint16_t mtu)
+{
+ int res = IPACM_SUCCESS;
+ int fd;
+ ipa_ioc_generate_flt_eq flt_eq;
+
+ if (rule == NULL)
+ {
+ IPACMERR("rule is empty");
+ return IPACM_FAILURE;
+ }
+
+ if (mtu == 0)
+ {
+ IPACMERR("mtu is uninitialized");
+ return IPACM_FAILURE;
+ }
+
+ IPACMDBG_H("Adding MTU rule for iptype = %d\n", iptype);
+
+ rule->eq_attrib_type = 1;
+ rule->eq_attrib.rule_eq_bitmap = 0;
+ rule->action = IPA_PASS_TO_EXCEPTION;
+
+ /* generate eq */
+ memset(&flt_eq, 0, sizeof(flt_eq));
+ memcpy(&flt_eq.attrib, &rule->attrib, sizeof(flt_eq.attrib));
+ flt_eq.ip = iptype;
+
+ fd = open(IPA_DEVICE_NAME, O_RDWR);
+ if (fd < 0)
+ {
+ IPACMERR("Failed opening %s.\n", IPA_DEVICE_NAME);
+ return IPACM_FAILURE;
+ }
+
+ if (0 != ioctl(fd, IPA_IOC_GENERATE_FLT_EQ, &flt_eq)) //define and cpy attribute to this struct
+ {
+ IPACMERR("Failed to get eq_attrib\n");
+ res = IPACM_FAILURE;
+ goto fail;
+ }
+ memcpy(&rule->eq_attrib,
+ &flt_eq.eq_attrib, sizeof(rule->eq_attrib));
+
+ //add IHL offsets
+ rule->eq_attrib.rule_eq_bitmap |= (1<<10);
+ rule->eq_attrib.num_ihl_offset_range_16 = 1;
+ if (iptype == IPA_IP_v4)
+ rule->eq_attrib.ihl_offset_range_16[0].offset = 0x82;
+ else
+ rule->eq_attrib.ihl_offset_range_16[0].offset = 0x84;
+ rule->eq_attrib.ihl_offset_range_16[0].range_low = mtu + 1;
+ rule->eq_attrib.ihl_offset_range_16[0].range_high = UINT16_MAX; //0xFFFF
+
+fail:
+ close(fd);
+ return res;
+}
diff --git a/ipacm/src/IPACM_Wan.cpp b/ipacm/src/IPACM_Wan.cpp
index 464a537..7f450e1 100644
--- a/ipacm/src/IPACM_Wan.cpp
+++ b/ipacm/src/IPACM_Wan.cpp
@@ -52,6 +52,7 @@
#include "linux/ipa_qmi_service_v01.h"
#ifdef FEATURE_IPACM_HAL
#include "IPACM_OffloadManager.h"
+#include <IPACM_Netlink.h>
#endif
bool IPACM_Wan::wan_up = false;
@@ -91,6 +92,8 @@
int IPACM_Wan::ipa_if_num_tether_v6[IPA_MAX_IFACE_ENTRIES];
#endif
+uint16_t IPACM_Wan::mtu_default_wan = DEFAULT_MTU_SIZE;
+
IPACM_Wan::IPACM_Wan(int iface_index,
ipacm_wan_iface_type is_sta_mode,
uint8_t *mac_addr) : IPACM_Iface(iface_index)
@@ -129,6 +132,7 @@
ext_prop = NULL;
is_ipv6_frag_firewall_flt_rule_installed = false;
ipv6_frag_firewall_flt_rule_hdl = 0;
+ mtu_size = DEFAULT_MTU_SIZE;
num_wan_client = 0;
header_name_count = 0;
@@ -1005,7 +1009,7 @@
if ((ipa_interface_index == ipa_if_num) && (m_is_sta_mode == Q6_WAN))
{
is_xlat_local = true;
- IPACMDBG_H("WAN-LTE (%s) link up, iface: %d is_xlat: %d\n",
+ IPACMDBG_H("WAN-LTE (%s) link up, iface: %d is_xlat_local: %d\n",
IPACM_Iface::ipacmcfg->iface_table[ipa_interface_index].iface_name,data->if_index, is_xlat_local);
}
break;
@@ -1818,6 +1822,9 @@
}
IPACMDBG_H("backhaul_is_wan_bridge ?: %d \n", IPACM_Wan::backhaul_is_wan_bridge);
+ /* query MTU size of the interface */
+ query_mtu_size();
+
if (m_is_sta_mode ==Q6_WAN)
{
IPACM_Wan::backhaul_mode = m_is_sta_mode;
@@ -1990,7 +1997,7 @@
IPACMDBG_H("hw-index-enable %d, counter %d\n", IPACM_Iface::ipacmcfg->hw_fnr_stats_support, IPACM_Iface::ipacmcfg->hw_counter_offset + UL_HW);
result = m_routing.AddRoutingRule_hw_index(rt_rule, IPACM_Iface::ipacmcfg->hw_counter_offset + UL_HW);
} else {
- result = m_routing.AddRoutingRule(rt_rule);
+ result = m_routing.AddRoutingRule(rt_rule);
}
#else
result = m_routing.AddRoutingRule(rt_rule);
@@ -2105,6 +2112,11 @@
wan_route_rule_v6_hdl_a5[0], 0, iptype);
}
+ /* set mtu_default_wan to current default wan instance */
+ mtu_default_wan = mtu_size;
+
+ IPACMDBG_H("replace the mtu_default_wan to %d\n", mtu_default_wan);
+
ipacm_event_iface_up *wanup_data;
wanup_data = (ipacm_event_iface_up *)malloc(sizeof(ipacm_event_iface_up));
if (wanup_data == NULL)
@@ -2146,13 +2158,13 @@
IPACM_Wan::is_xlat = is_xlat_local;
/* send xlat configuration for installing uplink rules */
- if(IPACM_Wan::is_xlat && (m_is_sta_mode == Q6_WAN))
+ if(is_xlat_local && (m_is_sta_mode == Q6_WAN))
{
IPACM_Wan::xlat_mux_id = ext_prop->ext[0].mux_id;
wanup_data->xlat_mux_id = IPACM_Wan::xlat_mux_id;
IPACMDBG_H("Set xlat configuraiton with below information:\n");
- IPACMDBG_H("xlat_enabled: %d xlat_mux_id: %d \n",
- IPACM_Wan::is_xlat, xlat_mux_id);
+ IPACMDBG_H("xlat_enabled: %d set xlat_mux_id: %d \n",
+ is_xlat_local, IPACM_Wan::xlat_mux_id);
}
else /*temp put xlat = 0 for Q6_MHI_WAN*/
{
@@ -2218,8 +2230,9 @@
IPACMDBG_H("dev %s add producer dependency\n", dev_name);
IPACMDBG_H("depend Got pipe %d rm index : %d \n", tx_prop->tx[0].dst_pipe, IPACM_Iface::ipacmcfg->ipa_client_rm_map_tbl[tx_prop->tx[0].dst_pipe]);
IPACM_Iface::ipacmcfg->AddRmDepend(IPACM_Iface::ipacmcfg->ipa_client_rm_map_tbl[tx_prop->tx[0].dst_pipe],false);
+ }
#ifdef WAN_IOC_NOTIFY_WAN_STATE
- } else {
+ else {
if ((m_is_sta_mode == Q6_WAN && ipa_pm_q6_check == 0 ) || (m_is_sta_mode == Q6_MHI_WAN))
{
fd_wwan_ioctl = open(WWAN_QMI_IOCTL_DEVICE_NAME, O_RDWR);
@@ -2240,9 +2253,8 @@
ipa_pm_q6_check++;
IPACMDBG_H("update ipa_pm_q6_check to %d\n", ipa_pm_q6_check);
}
-#else
- }
#endif
+
if(rt_rule != NULL)
{
free(rt_rule);
@@ -2268,7 +2280,7 @@
wanup_data->if_index_tether = ipa_if_num_tether;
wanup_data->backhaul_type = m_is_sta_mode;
/* xlat mux-id*/
- if(is_xlat && (m_is_sta_mode == Q6_WAN))
+ if(is_xlat_local && (m_is_sta_mode == Q6_WAN))
wanup_data->xlat_mux_id = ext_prop->ext[0].mux_id;
else
wanup_data->xlat_mux_id = 0;
@@ -4785,6 +4797,7 @@
int fd_wwan_ioctl;
memset(&wan_state, 0, sizeof(wan_state));
#endif
+ int ret = IPACM_SUCCESS;
IPACMDBG_H("got handle_route_del_evt for STA-mode with ip-family:%d \n", iptype);
@@ -4914,24 +4927,19 @@
if(delete_offload_frag_rule())
{
IPACMERR("Failed to delete DL frag rule \n");
- return IPACM_FAILURE;
+ ret = IPACM_FAILURE;
}
- /* Delete MHI icmpv6 exception rule */
- if(delete_icmpv6_exception_rule())
- {
- IPACMERR("Failed to delete icmpv6 rule \n");
- return IPACM_FAILURE;
- }
+
/* Delete tcp_fin_rst rule */
if(delete_tcp_fin_rst_exception_rule())
{
IPACMERR("Failed to delete tcp_fin_rst rule \n");
- return IPACM_FAILURE;
+ ret = IPACM_FAILURE;
}
+ return ret;
}
else
{
-
wandown_data->backhaul_type = m_is_sta_mode;
memcpy(wandown_data->ipv6_prefix, ipv6_prefix, sizeof(wandown_data->ipv6_prefix));
evt_data.event = IPA_HANDLE_WAN_DOWN_V6;
@@ -4950,6 +4958,13 @@
{
memset(IPACM_Wan::wan_up_dev_name, 0, sizeof(IPACM_Wan::wan_up_dev_name));
}
+ /* Delete MHI icmpv6 exception rule */
+ if(delete_icmpv6_exception_rule())
+ {
+ IPACMERR("Failed to delete icmpv6 rule \n");
+ return IPACM_FAILURE;
+ }
+
}
}
else
@@ -4989,8 +5004,9 @@
IPACMDBG_H("dev %s delete producer dependency\n", dev_name);
IPACMDBG_H("depend Got pipe %d rm index : %d \n", tx_prop->tx[0].dst_pipe, IPACM_Iface::ipacmcfg->ipa_client_rm_map_tbl[tx_prop->tx[0].dst_pipe]);
IPACM_Iface::ipacmcfg->DelRmDepend(IPACM_Iface::ipacmcfg->ipa_client_rm_map_tbl[tx_prop->tx[0].dst_pipe]);
+ }
#ifdef WAN_IOC_NOTIFY_WAN_STATE
- } else {
+ else {
IPACMDBG_H("ipa_pm_q6_check to %d\n", ipa_pm_q6_check);
if(ipa_pm_q6_check == 1)
{
@@ -5012,8 +5028,6 @@
else
IPACMERR(" ipa_pm_q6_check becomes negative !!!\n");
}
-#else
-}
#endif
/* Delete the default route*/
if (iptype == IPA_IP_v6)
@@ -5554,6 +5568,9 @@
goto fail;
}
+ /* reset the mtu size */
+ mtu_size = DEFAULT_MTU_SIZE;
+
if(ip_type == IPA_IP_v4)
{
num_ipv4_modem_pdn--;
@@ -7913,3 +7930,33 @@
}
return res;
}
+
+int IPACM_Wan::query_mtu_size()
+{
+ int fd;
+ struct ifreq if_mtu;
+
+ fd = socket(AF_INET, SOCK_DGRAM, 0);
+ if ( fd < 0 ) {
+ IPACMERR("ipacm: socket open failed [%d]\n", fd);
+ return IPACM_FAILURE;
+ }
+
+ strlcpy(if_mtu.ifr_name, dev_name, IFNAMSIZ);
+ IPACMDBG_H("device name: %s\n", dev_name);
+ if_mtu.ifr_name[IFNAMSIZ - 1] = '\0';
+
+ if ( ioctl(fd, SIOCGIFMTU, &if_mtu) < 0 ) {
+ IPACMERR("ioctl failed to get mtu\n");
+ close(fd);
+ return IPACM_FAILURE;
+ }
+ IPACMDBG_H("mtu=[%d]\n", if_mtu.ifr_mtu);
+ if (if_mtu.ifr_mtu < DEFAULT_MTU_SIZE) {
+ mtu_size = if_mtu.ifr_mtu;
+ IPACMDBG_H("replaced mtu=[%d] for (%s)\n", mtu_size, dev_name);
+ }
+
+ close(fd);
+ return IPACM_SUCCESS;
+}
diff --git a/ipacm/src/IPACM_Wlan.cpp b/ipacm/src/IPACM_Wlan.cpp
index 48fcc7e..d5d38ca 100644
--- a/ipacm/src/IPACM_Wlan.cpp
+++ b/ipacm/src/IPACM_Wlan.cpp
@@ -562,15 +562,19 @@
{
IPACMDBG_H("Received IPA_DOWNSTREAM_ADD event.\n");
#ifdef FEATURE_IPA_ANDROID
- /* indicate v4-offload */
- IPACM_OffloadManager::num_offload_v4_tethered_iface++;
-
- /* xlat not support for 2st tethered iface sky */
- if (IPACM_Wan::isXlat() && (data->prefix.iptype == IPA_IP_v4) && (IPACM_OffloadManager::num_offload_v4_tethered_iface > 1))
+ if (IPACM_Wan::isXlat() && (data->prefix.iptype == IPA_IP_v4))
{
- IPACMDBG_H("Not support 2st downstream iface %s for xlat, cur: %d\n", dev_name,
- IPACM_OffloadManager::num_offload_v4_tethered_iface);
- return;
+ /* indicate v4-offload */
+ IPACM_OffloadManager::num_offload_v4_tethered_iface++;
+ IPACMDBG_H("in xlat: update num_offload_v4_tethered_iface %d\n", IPACM_OffloadManager::num_offload_v4_tethered_iface);
+
+ /* xlat not support for 2st tethered iface */
+ if (IPACM_OffloadManager::num_offload_v4_tethered_iface > 1)
+ {
+ IPACMDBG_H("Not support 2st downstream iface %s for xlat, cur: %d\n", dev_name,
+ IPACM_OffloadManager::num_offload_v4_tethered_iface);
+ return;
+ }
}
IPACMDBG_H(" support downstream iface %s, cur %d\n", dev_name,
@@ -602,6 +606,7 @@
ext_prop = IPACM_Iface::ipacmcfg->GetExtProp(data->prefix.iptype);
if (data->prefix.iptype == IPA_IP_v4)
{
+ IPACMDBG_H("check getXlat_Mux_Id:%d\n", IPACM_Wan::getXlat_Mux_Id());
handle_wan_up_ex(ext_prop, data->prefix.iptype,
IPACM_Wan::getXlat_Mux_Id());
}
@@ -1950,16 +1955,16 @@
}
/* delete private-ipv4 filter rules */
#ifdef FEATURE_IPA_ANDROID
- if(m_filtering.DeleteFilteringHdls(private_fl_rule_hdl, IPA_IP_v4, IPA_MAX_PRIVATE_SUBNET_ENTRIES) == false)
+ if(m_filtering.DeleteFilteringHdls(private_fl_rule_hdl, IPA_IP_v4, IPA_MAX_PRIVATE_SUBNET_ENTRIES + IPA_MAX_MTU_ENTRIES) == false)
{
IPACMERR("Error deleting private subnet IPv4 flt rules.\n");
res = IPACM_FAILURE;
goto fail;
}
- IPACM_Iface::ipacmcfg->decreaseFltRuleCount(rx_prop->rx[0].src_pipe, IPA_IP_v4, IPA_MAX_PRIVATE_SUBNET_ENTRIES);
+ IPACM_Iface::ipacmcfg->decreaseFltRuleCount(rx_prop->rx[0].src_pipe, IPA_IP_v4, IPA_MAX_PRIVATE_SUBNET_ENTRIES + IPA_MAX_MTU_ENTRIES);
#else
- num_private_subnet_fl_rule = IPACM_Iface::ipacmcfg->ipa_num_private_subnet > IPA_MAX_PRIVATE_SUBNET_ENTRIES?
- IPA_MAX_PRIVATE_SUBNET_ENTRIES : IPACM_Iface::ipacmcfg->ipa_num_private_subnet;
+ num_private_subnet_fl_rule = IPACM_Iface::ipacmcfg->ipa_num_private_subnet > (IPA_MAX_PRIVATE_SUBNET_ENTRIES + IPA_MAX_MTU_ENTRIES)?
+ (IPA_MAX_PRIVATE_SUBNET_ENTRIES + IPA_MAX_MTU_ENTRIES) : IPACM_Iface::ipacmcfg->ipa_num_private_subnet;
if(m_filtering.DeleteFilteringHdls(private_fl_rule_hdl, IPA_IP_v4, num_private_subnet_fl_rule) == false)
{
IPACMERR("Error deleting private subnet flt rules, aborting...\n");