Merge "IPACM: Handle AF_BRIDGE netlink message"
diff --git a/ipacm/src/IPACM_IfaceManager.cpp b/ipacm/src/IPACM_IfaceManager.cpp
index c8eb2c9..03233b5 100644
--- a/ipacm/src/IPACM_IfaceManager.cpp
+++ b/ipacm/src/IPACM_IfaceManager.cpp
@@ -267,7 +267,7 @@
 			{
 				if(IPACM_Iface::ipacmcfg->ipacm_odu_router_mode == true)
 				{
-					IPACMDBG("Creating ODU interface in router mode\n");
+					IPACMDBG_H("Creating ODU interface in router mode\n");
 					IPACM_Lan *odu = new IPACM_Lan(ipa_interface_index);
 					IPACM_EvtDispatcher::registr(IPA_ADDR_ADD_EVENT, odu);
 					IPACM_EvtDispatcher::registr(IPA_NEIGH_CLIENT_IP_ADDR_ADD_EVENT, odu);
@@ -289,14 +289,14 @@
 					IPACM_EvtDispatcher::registr(IPA_CRADLE_WAN_MODE_SWITCH, odu);
 					IPACM_EvtDispatcher::registr(IPA_LINK_DOWN_EVENT, odu);
 					IPACM_EvtDispatcher::registr(IPA_LAN_DELETE_SELF, odu);
-					IPACMDBG("ipa_LAN (%s):ipa_index (%d) instance open/registr ok\n", odu->dev_name, odu->ipa_if_num);
+					IPACMDBG_H("ipa_LAN (%s):ipa_index (%d) instance open/registr ok\n", odu->dev_name, odu->ipa_if_num);
 					registr(ipa_interface_index, odu);
 					/* solve the new_addr comes earlier issue */
 					IPACM_Iface::iface_addr_query(if_index);
 				}
 				else
 				{
-					IPACMDBG("Creating ODU interface in bridge mode\n");
+					IPACMDBG_H("Creating ODU interface in bridge mode\n");
 					IPACM_Lan *odu = new IPACM_Lan(ipa_interface_index);
 					IPACM_EvtDispatcher::registr(IPA_ADDR_ADD_EVENT, odu);
 					IPACM_EvtDispatcher::registr(IPA_NEIGH_CLIENT_IP_ADDR_ADD_EVENT, odu);
@@ -304,7 +304,7 @@
 					IPACM_EvtDispatcher::registr(IPA_SW_ROUTING_DISABLE, odu);
 					IPACM_EvtDispatcher::registr(IPA_LINK_DOWN_EVENT, odu);
 					IPACM_EvtDispatcher::registr(IPA_LAN_DELETE_SELF, odu);
-					IPACMDBG("ipa_LAN (%s):ipa_index (%d) instance open/registr ok\n", odu->dev_name, odu->ipa_if_num);
+					IPACMDBG_H("ipa_LAN (%s):ipa_index (%d) instance open/registr ok\n", odu->dev_name, odu->ipa_if_num);
 					registr(ipa_interface_index, odu);
 					/* solve the new_addr comes earlier issue */
 					IPACM_Iface::iface_addr_query(if_index);
diff --git a/ipacm/src/IPACM_Netlink.cpp b/ipacm/src/IPACM_Netlink.cpp
index 13b1d6e..3dfc514 100644
--- a/ipacm/src/IPACM_Netlink.cpp
+++ b/ipacm/src/IPACM_Netlink.cpp
@@ -639,13 +639,16 @@
 				IPACMDBG("RTM_NEWLINK, ifi_flags:%d\n", msg_ptr->nl_link_info.metainfo.ifi_flags);
 				IPACMDBG("RTM_NEWLINK, ifi_index:%d\n", msg_ptr->nl_link_info.metainfo.ifi_index);
 				IPACMDBG("RTM_NEWLINK, family:%d\n", msg_ptr->nl_link_info.metainfo.ifi_family);
-
+				/* RTM_NEWLINK event with AF_BRIDGE family should be ignored in Android
+				   but this should be processed in case of MDM for Ehernet interface.
+				*/
+#ifdef FEATURE_IPA_ANDROID
 				if (msg_ptr->nl_link_info.metainfo.ifi_family == AF_BRIDGE)
 				{
 					IPACMERR(" ignore this RTM_NEWLINK msg \n");
 					return IPACM_SUCCESS;
 				}
-
+#endif
 				if(IFF_UP & msg_ptr->nl_link_info.metainfo.ifi_change)
 				{
 					IPACMDBG("GOT useful newlink event\n");
@@ -707,7 +710,7 @@
 						IPACMERR("Error while getting interface name\n");
 						return IPACM_FAILURE;
 					}
-				    IPACMDBG("Got a usb link_up event (Interface %s, %d) \n", dev_name, msg_ptr->nl_link_info.metainfo.ifi_index);
+					IPACMDBG("Got a usb link_up event (Interface %s, %d) \n", dev_name, msg_ptr->nl_link_info.metainfo.ifi_index);
 
                                         /*--------------------------------------------------------------------------
                                            Post LAN iface (ECM) link up event
@@ -715,7 +718,7 @@
                                         evt_data.event = IPA_USB_LINK_UP_EVENT;
 					evt_data.evt_data = data_fid;
 					IPACM_EvtDispatcher::PostEvt(&evt_data);
-					IPACMDBG("Posting usb IPA_LINK_UP_EVENT with if index: %d\n",
+					IPACMDBG_H("Posting usb IPA_LINK_UP_EVENT with if index: %d\n",
 										 data_fid->if_index);
                                 }
                                 else if(!(msg_ptr->nl_link_info.metainfo.ifi_flags & IFF_LOWER_UP))
@@ -734,17 +737,16 @@
 						IPACMERR("Error while getting interface name\n");
 						return IPACM_FAILURE;
 					}
-         		    IPACMDBG_H("Got a usb link_down event (Interface %s) \n", dev_name);
+					IPACMDBG_H("Got a usb link_down event (Interface %s) \n", dev_name);
 
-                    /*--------------------------------------------------------------------------
-                       Post LAN iface (ECM) link down event
-                     ---------------------------------------------------------------------------*/
-                    evt_data.event = IPA_LINK_DOWN_EVENT;
+					/*--------------------------------------------------------------------------
+						Post LAN iface (ECM) link down event
+					---------------------------------------------------------------------------*/
+					evt_data.event = IPA_LINK_DOWN_EVENT;
 					evt_data.evt_data = data_fid;
 					IPACM_EvtDispatcher::PostEvt(&evt_data);
 					IPACMDBG_H("Posting usb IPA_LINK_DOWN_EVENT with if index: %d\n",
 										 data_fid->if_index);
-
                                 }
 			}
 			break;
@@ -766,13 +768,16 @@
 				IPACMDBG("RTM_DELLINK, ifi_flags:%d\n", msg_ptr->nl_link_info.metainfo.ifi_flags);
 				IPACMDBG("RTM_DELLINK, ifi_index:%d\n", msg_ptr->nl_link_info.metainfo.ifi_index);
 				IPACMDBG("RTM_DELLINK, family:%d\n", msg_ptr->nl_link_info.metainfo.ifi_family);
-
+				/* RTM_NEWLINK event with AF_BRIDGE family should be ignored in Android
+				   but this should be processed in case of MDM for Ehernet interface.
+				*/
+#ifdef FEATURE_IPA_ANDROID
 				if (msg_ptr->nl_link_info.metainfo.ifi_family == AF_BRIDGE)
 				{
 					IPACMERR(" ignore this RTM_DELLINK msg \n");
 					return IPACM_SUCCESS;
 				}
-
+#endif
 				ret_val = ipa_get_if_name(dev_name, msg_ptr->nl_link_info.metainfo.ifi_index);
 				if(ret_val != IPACM_SUCCESS)
 				{