core: print ifindex when logging UDEV event

Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Thomas Haller 2013-10-15 19:45:42 +02:00
parent f03635e5ac
commit 1d0a26e19d
2 changed files with 11 additions and 4 deletions

View file

@ -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);

View file

@ -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);