diff options
author | Thomas Haller <thaller@redhat.com> | 2013-10-15 19:45:42 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2013-10-15 19:45:42 +0200 |
commit | 1d0a26e19de1133bb1ea8294f8f5d8472bedd859 (patch) | |
tree | d638a092fee8e2d0b5364c907f39b33b14f44f7d | |
parent | f03635e5ac829d4fc896573f2f3c6969b9d5a2e2 (diff) | |
download | NetworkManager-1d0a26e19de1133bb1ea8294f8f5d8472bedd859.tar.gz |
core: print ifindex when logging UDEV event
Signed-off-by: Thomas Haller <thaller@redhat.com>
-rw-r--r-- | src/nm-atm-manager.c | 7 | ||||
-rw-r--r-- | src/platform/nm-linux-platform.c | 8 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/nm-atm-manager.c b/src/nm-atm-manager.c index c4df9dc2a2..fb4bf964a4 100644 --- a/src/nm-atm-manager.c +++ b/src/nm-atm-manager.c @@ -145,6 +145,7 @@ handle_uevent (GUdevClient *client, { NMAtmManager *self = NM_ATM_MANAGER (user_data); const char *subsys; + const char *ifindex; g_return_if_fail (action != NULL); @@ -152,8 +153,10 @@ handle_uevent (GUdevClient *client, subsys = g_udev_device_get_subsystem (device); g_return_if_fail (!g_strcmp0 (subsys, "atm")); - nm_log_dbg (LOGD_HW, "UDEV event: action '%s' subsys '%s' device '%s'", - action, subsys, g_udev_device_get_name (device)); + ifindex = g_udev_device_get_sysfs_attr (device, "ifindex"); + + nm_log_dbg (LOGD_HW, "UDEV event: action '%s' subsys '%s' device '%s' (%s)", + action, subsys, g_udev_device_get_name (device), ifindex ? ifindex : "unknown"); if (!strcmp (action, "add")) adsl_add (self, device); diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index dd8bf63263..519a570dd7 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -2546,6 +2546,7 @@ handle_udev_event (GUdevClient *client, { NMPlatform *platform = NM_PLATFORM (user_data); const char *subsys; + const char *ifindex; g_return_if_fail (action != NULL); @@ -2553,8 +2554,11 @@ handle_udev_event (GUdevClient *client, subsys = g_udev_device_get_subsystem (udev_device); g_return_if_fail (!g_strcmp0 (subsys, "net")); - debug ("UDEV event: action '%s' subsys '%s' device '%s'", - action, subsys, g_udev_device_get_name (udev_device)); + ifindex = g_udev_device_get_sysfs_attr (udev_device, "ifindex"); + + debug ("UDEV event: action '%s' subsys '%s' device '%s' (%s)", + action, subsys, g_udev_device_get_name (udev_device), + ifindex ? ifindex : "unknown"); if (!strcmp (action, "add")) udev_device_added (platform, udev_device); |