about summary refs log tree commit diff
path: root/debian/patches/08-hal_deprecated_keys.patch
blob: 5e09f8c2c19df09ccaad2817118a27b93e3b0e1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Index: src/nm-device.c
===================================================================
--- src/nm-device.c	(Revision 3527)
+++ src/nm-device.c	(Arbeitskopie)
@@ -115,19 +115,24 @@
 nm_get_device_driver_name (LibHalContext *ctx, const char *udi)
 {
 	char	*	driver_name = NULL;
-	char *	physdev_udi = NULL;
+	char *	origdev_udi = NULL;
 
 	g_return_val_if_fail (ctx != NULL, NULL);
 	g_return_val_if_fail (udi != NULL, NULL);
 
-	physdev_udi = libhal_device_get_property_string (ctx, udi, "net.physical_device", NULL);
-	if (physdev_udi && libhal_device_property_exists (ctx, physdev_udi, "info.linux.driver", NULL))
+	origdev_udi = libhal_device_get_property_string (ctx, udi, "net.originating_device", NULL);
+	if (!origdev_udi) {
+		/* Older HAL uses 'physical_device' */
+		origdev_udi = libhal_device_get_property_string (ctx, udi, "net.physical_device", NULL);
+	}
+
+	if (origdev_udi && libhal_device_property_exists (ctx, origdev_udi, "info.linux.driver", NULL))
 	{
-		char *drv = libhal_device_get_property_string (ctx, physdev_udi, "info.linux.driver", NULL);
+		char *drv = libhal_device_get_property_string (ctx, origdev_udi, "info.linux.driver", NULL);
 		driver_name = g_strdup (drv);
 		g_free (drv);
 	}
-	g_free (physdev_udi);
+	g_free (origdev_udi);
 
 	return driver_name;
 }