mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-15 18:30:38 +01:00
core: log netlink link messages
This commit is contained in:
parent
d0f2a50680
commit
157e9f791d
1 changed files with 8 additions and 9 deletions
|
|
@ -186,6 +186,7 @@ netlink_object_message_handler (struct nl_object *obj, void *arg)
|
|||
struct rtnl_link *filter;
|
||||
struct rtnl_link *link_obj;
|
||||
guint flags;
|
||||
guint ifidx;
|
||||
|
||||
filter = rtnl_link_alloc ();
|
||||
if (!filter) {
|
||||
|
|
@ -206,19 +207,17 @@ netlink_object_message_handler (struct nl_object *obj, void *arg)
|
|||
|
||||
link_obj = (struct rtnl_link *) obj;
|
||||
flags = rtnl_link_get_flags (link_obj);
|
||||
ifidx = rtnl_link_get_ifindex (link_obj);
|
||||
|
||||
nm_log_dbg (LOGD_HW, "netlink link message: iface idx %d flags 0x%X", ifidx, flags);
|
||||
|
||||
/* IFF_LOWER_UP is the indicator of carrier status since kernel commit
|
||||
* b00055aacdb172c05067612278ba27265fcd05ce in 2.6.17.
|
||||
*/
|
||||
if (flags & IFF_LOWER_UP) {
|
||||
g_signal_emit (G_OBJECT (monitor),
|
||||
signals[CARRIER_ON],
|
||||
0, rtnl_link_get_ifindex (link_obj));
|
||||
} else {
|
||||
g_signal_emit (G_OBJECT (monitor),
|
||||
signals[CARRIER_OFF],
|
||||
0, rtnl_link_get_ifindex (link_obj));
|
||||
}
|
||||
if (flags & IFF_LOWER_UP)
|
||||
g_signal_emit (G_OBJECT (monitor), signals[CARRIER_ON], 0, ifidx);
|
||||
else
|
||||
g_signal_emit (G_OBJECT (monitor), signals[CARRIER_OFF], 0, ifidx);
|
||||
|
||||
out:
|
||||
rtnl_link_put (filter);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue