Merge "IPACM: fix the wlan MCC mode failed"
diff --git a/ipacm/inc/IPACM_Wan.h b/ipacm/inc/IPACM_Wan.h
index 9009136..132203c 100644
--- a/ipacm/inc/IPACM_Wan.h
+++ b/ipacm/inc/IPACM_Wan.h
@@ -149,8 +149,6 @@
 	bool header_partial_default_wan_v4;
 	bool header_partial_default_wan_v6;
 	uint8_t ext_router_mac_addr[IPA_MAC_ADDR_SIZE];
-	uint16_t eth2_ofst_v4;
-	uint16_t eth2_ofst_v6;
 
 	static int num_ipv4_modem_pdn;
 
diff --git a/ipacm/src/IPACM_Lan.cpp b/ipacm/src/IPACM_Lan.cpp
index ff64335..e8551ba 100644
--- a/ipacm/src/IPACM_Lan.cpp
+++ b/ipacm/src/IPACM_Lan.cpp
@@ -1839,7 +1839,6 @@
 
 				/* Replace the v4 header in ODU interface */
 				if (IPACM_Iface::ipacmcfg->iface_table[ipa_if_num].if_cat == ODU_IF)
-				rt_rule_entry->rule.hdr_hdl = ODU_hdr_hdl_v4;
 
 			    if (false == m_routing.AddRoutingRule(rt_rule))
   	            {
@@ -1867,10 +1866,6 @@
 			    					IPACM_Iface::ipacmcfg->rt_tbl_v6.name,
 			    					sizeof(rt_rule->rt_tbl_name));
 
-				   /* Replace v6 header in ODU interface */
-				   if (IPACM_Iface::ipacmcfg->iface_table[ipa_if_num].if_cat == ODU_IF)
-						rt_rule_entry->rule.hdr_hdl = ODU_hdr_hdl_v6;
-
 		            /* Support QCMAP LAN traffic feature, send to A5 */
 					rt_rule_entry->rule.dst = IPA_CLIENT_APPS_LAN_CONS;
 			        memset(&rt_rule_entry->rule.attrib, 0, sizeof(rt_rule_entry->rule.attrib));
diff --git a/ipacm/src/IPACM_Wan.cpp b/ipacm/src/IPACM_Wan.cpp
index 552d6d2..677afe1 100644
--- a/ipacm/src/IPACM_Wan.cpp
+++ b/ipacm/src/IPACM_Wan.cpp
@@ -4599,7 +4599,19 @@
 								/* copy client mac_addr to partial header */
 								IPACMDBG_H("header eth2_ofst_valid: %d, eth2_ofst: %d\n",
 										sCopyHeader.is_eth2_ofst_valid, sCopyHeader.eth2_ofst);
-								memcpy(&pHeaderDescriptor->hdr[0].hdr[eth2_ofst_v4], mac_addr, IPA_MAC_ADDR_SIZE); /* only copy 6 bytes mac-address */
+
+								/* only copy 6 bytes mac-address */
+								if(sCopyHeader.is_eth2_ofst_valid == false)
+								{
+									memcpy(&pHeaderDescriptor->hdr[0].hdr[0],
+											mac_addr, IPA_MAC_ADDR_SIZE);
+								}
+								else
+								{
+									memcpy(&pHeaderDescriptor->hdr[0].hdr[sCopyHeader.eth2_ofst],
+											mac_addr, IPA_MAC_ADDR_SIZE);
+								}
+
 
 								pHeaderDescriptor->commit = true;
 								pHeaderDescriptor->num_hdrs = 1;
@@ -4682,11 +4694,21 @@
 				{
 					memcpy(pHeaderDescriptor->hdr[0].hdr,
 							sCopyHeader.hdr,
-								sCopyHeader.hdr_len);
+							sCopyHeader.hdr_len);
 				}
 
 				/* copy client mac_addr to partial header */
-				memcpy(&pHeaderDescriptor->hdr[0].hdr[eth2_ofst_v6], mac_addr, IPA_MAC_ADDR_SIZE); /* only copy 6 bytes mac-address */
+				if(sCopyHeader.is_eth2_ofst_valid == false)
+				{
+					memcpy(&pHeaderDescriptor->hdr[0].hdr[0],
+								 mac_addr, IPA_MAC_ADDR_SIZE); /* only copy 6 bytes mac-address */
+				}
+				else
+				{
+					memcpy(&pHeaderDescriptor->hdr[0].hdr[sCopyHeader.eth2_ofst],
+								 mac_addr, IPA_MAC_ADDR_SIZE); /* only copy 6 bytes mac-address */
+				}
+
 
 				pHeaderDescriptor->commit = true;
 				pHeaderDescriptor->num_hdrs = 1;