summaryrefslogtreecommitdiff
path: root/ipacm/src/IPACM_Netlink.cpp
diff options
context:
space:
mode:
authorSkylar Chang <chiaweic@codeaurora.org>2015-07-16 17:55:49 -0700
committerSkylar Chang <chiaweic@codeaurora.org>2015-07-16 18:07:11 -0700
commitdb9914321f0ddaddf67e14b12b8fd6271baca805 (patch)
treedb2ee73f67eec05fa54834f76c49a949f49f051d /ipacm/src/IPACM_Netlink.cpp
parentd5611c71c1d965ada3567dee743cf910331bccfe (diff)
downloadipacfg-mgr-db9914321f0ddaddf67e14b12b8fd6271baca805.tar.gz
IPACM: Handle AF_BRIDGE netlink message
AF_BRIGE family netlink message should be processed for LE targets. It is used by CPE interface while device is booting with cable connected. But it should be ignored in MSM target to avoid fake USB interface down netlink message. Change-Id: Iafd1f06819cbc010415368e0c919cd4d43e274e0
Diffstat (limited to 'ipacm/src/IPACM_Netlink.cpp')
-rw-r--r--ipacm/src/IPACM_Netlink.cpp29
1 files changed, 17 insertions, 12 deletions
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 @@ static int ipa_nl_decode_nlmsg
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 @@ static int ipa_nl_decode_nlmsg
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 @@ static int ipa_nl_decode_nlmsg
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 @@ static int ipa_nl_decode_nlmsg
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 @@ static int ipa_nl_decode_nlmsg
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)
{