chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tmpfiles: always recreate the most basic directory structure in /var
[elogind.git]
/
src
/
udev
/
udev-builtin-net_setup_link.c
diff --git
a/src/udev/udev-builtin-net_setup_link.c
b/src/udev/udev-builtin-net_setup_link.c
index 6a98b802b2faf7cce52e30d8705d7baa58cf093e..3cd384e94dc8ecf144dc039317175fc9bc7a959c 100644
(file)
--- a/
src/udev/udev-builtin-net_setup_link.c
+++ b/
src/udev/udev-builtin-net_setup_link.c
@@
-23,9
+23,11
@@
#include "udev.h"
#include "log.h"
#include "udev.h"
#include "log.h"
-
link_config_ctx *ctx
;
+
static link_config_ctx *ctx = NULL
;
static int builtin_net_setup_link(struct udev_device *dev, int argc, char **argv, bool test) {
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;
link_config *link;
int r;
@@
-34,6
+36,10
@@
static int builtin_net_setup_link(struct udev_device *dev, int argc, char **argv
return EXIT_FAILURE;
}
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) {
r = link_config_get(ctx, dev, &link);
if (r < 0) {
if (r == -ENOENT) {
@@
-45,12
+51,15
@@
static int builtin_net_setup_link(struct udev_device *dev, int argc, char **argv
}
}
}
}
- r = link_config_apply(ctx, link, dev);
+ r = link_config_apply(ctx, link, dev
, &name
);
if (r < 0) {
log_error("Could not apply link config to %s", udev_device_get_sysname(dev));
return EXIT_FAILURE;
}
if (r < 0) {
log_error("Could not apply link config to %s", udev_device_get_sysname(dev));
return EXIT_FAILURE;
}
+ if (name)
+ udev_builtin_add_property(dev, test, "ID_NET_NAME", name);
+
return EXIT_SUCCESS;
}
return EXIT_SUCCESS;
}