summaryrefslogtreecommitdiff
path: root/src/udev/udev-builtin-net_setup_link.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-02-21 16:54:00 +0100
committerTom Gundersen <teg@jklm.no>2014-02-21 21:00:39 +0100
commit847a8a5fed4d265dfa659917515c6f9bd1b8d5c4 (patch)
treea66310a760d1ea59a366113d4ce5d35cd3f0c014 /src/udev/udev-builtin-net_setup_link.c
parenta0eb2a751c6f3e9c233772cd9af8e8ee1504d27a (diff)
udev - link-setup - expose ID_NET_DRIVER
This is the same as shown by 'ethtool -i <ifname>', and is sometimes set even though DRIVER is not.
Diffstat (limited to 'src/udev/udev-builtin-net_setup_link.c')
-rw-r--r--src/udev/udev-builtin-net_setup_link.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/udev/udev-builtin-net_setup_link.c b/src/udev/udev-builtin-net_setup_link.c
index b7ba8c9060..3cd384e94d 100644
--- a/src/udev/udev-builtin-net_setup_link.c
+++ b/src/udev/udev-builtin-net_setup_link.c
@@ -26,6 +26,7 @@
static link_config_ctx *ctx = NULL;
static int builtin_net_setup_link(struct udev_device *dev, int argc, char **argv, bool test) {
+ _cleanup_free_ char *driver = NULL;
const char *name;
link_config *link;
int r;
@@ -35,6 +36,10 @@ static int builtin_net_setup_link(struct udev_device *dev, int argc, char **argv
return EXIT_FAILURE;
}
+ r = link_get_driver(ctx, dev, &driver);
+ if (r >= 0)
+ udev_builtin_add_property(dev, test, "ID_NET_DRIVER", driver);
+
r = link_config_get(ctx, dev, &link);
if (r < 0) {
if (r == -ENOENT) {