Merge "ipacm: add dynamic support for ipa coalesce"
diff --git a/ipacm/src/Android.mk b/ipacm/src/Android.mk
index 95635c2..9cbe1e2 100644
--- a/ipacm/src/Android.mk
+++ b/ipacm/src/Android.mk
@@ -1,3 +1,4 @@
+ifneq ($(TARGET_HAS_LOW_RAM),true)
 BOARD_PLATFORM_LIST := msm8909
 BOARD_PLATFORM_LIST += msm8916
 BOARD_PLATFORM_LIST += msm8917
@@ -121,3 +122,4 @@
 endif # $(TARGET_ARCH)
 endif
 endif
+endif
diff --git a/ipacm/src/IPACM_Wan.cpp b/ipacm/src/IPACM_Wan.cpp
index 26210ea..6f46f70 100644
--- a/ipacm/src/IPACM_Wan.cpp
+++ b/ipacm/src/IPACM_Wan.cpp
@@ -140,6 +140,7 @@
 	is_default_gateway = false;
 	m_fd_ipa = 0;
 	wan_client_len = 0;
+	m_is_sta_mode = is_sta_mode;
 
 	if(iface_query != NULL)
 	{
@@ -2083,10 +2084,13 @@
 			IPACM_Wan::xlat_mux_id = 0;
 			wanup_data->xlat_mux_id = 0;
 			if(m_is_sta_mode != WLAN_WAN) //both q6_wan/q6_mhi_wan
+			{
 				wanup_data->mux_id = ext_prop->ext[0].mux_id;
+				IPACMDBG_H("mux_id: %d\n", wanup_data->mux_id);
+			}
 			else
 				wanup_data->mux_id = 0;
-			IPACMDBG_H("No xlat configuration mux-id %d %d\n", ext_prop->ext[0].mux_id, wanup_data->mux_id);
+			IPACMDBG_H("No xlat configuration\n");
 		}
 		evt_data.event = IPA_HANDLE_WAN_UP;
 		evt_data.evt_data = (void *)wanup_data;
diff --git a/ipacm/src/IPACM_Xml.cpp b/ipacm/src/IPACM_Xml.cpp
index 4451906..d59bbb0 100644
--- a/ipacm/src/IPACM_Xml.cpp
+++ b/ipacm/src/IPACM_Xml.cpp
@@ -1,5 +1,5 @@
 /*
-Copyright (c) 2013, The Linux Foundation. All rights reserved.
+Copyright (c) 2013, 2019, The Linux Foundation. All rights reserved.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are
@@ -75,6 +75,7 @@
 )
 {
 	xmlNode* child_ptr;
+	uint32_t str_len;
 
 	for (child_ptr  = element->children;
 			 child_ptr != NULL;
@@ -82,7 +83,15 @@
 	{
 		if (child_ptr->type == XML_TEXT_NODE)
 		{
-			return (char*)child_ptr->content;
+			str_len = strlen((char*)child_ptr->content);
+
+			if(str_len < MAX_XML_STR_LEN)
+				return (char*)child_ptr->content;
+			else
+			{
+				IPACMERR("Invalid string size\n");
+				break;
+			}
 		}
 	}
 	return NULL;