chiark / gitweb /
Remove src/tty-ask-password-agent
[elogind.git] / src / udev / net / link-config.c
index ad5b9563582788aae7bea953870299c51ce16bb8..86d09bbff21050a3a0d5ff2b7ba344b795ea1673 100644 (file)
@@ -22,7 +22,6 @@
 #include <netinet/ether.h>
 #include <linux/netdevice.h>
 
-#include "sd-id128.h"
 
 #include "missing.h"
 #include "link-config.h"
 #include "path-util.h"
 #include "conf-parser.h"
 #include "conf-files.h"
-#include "fileio.h"
-#include "hashmap.h"
 #include "rtnl-util.h"
 #include "network-internal.h"
-#include "siphash24.h"
 
 struct link_config_ctx {
         LIST_HEAD(link_config, links);
@@ -259,7 +255,7 @@ int link_config_get(link_config_ctx *ctx, struct udev_device *device,
 
                                 attr_value = udev_device_get_sysattr_value(device, "name_assign_type");
                                 if (attr_value)
-                                        (void)safe_atou8(attr_value, &name_assign_type);
+                                        (void) safe_atou8(attr_value, &name_assign_type);
 
                                 if (name_assign_type == NET_NAME_ENUM) {
                                         log_warning("Config file %s applies to device based on potentially unpredictable interface name '%s'",
@@ -438,9 +434,10 @@ int link_config_apply(link_config_ctx *ctx, link_config *config,
                 case MACPOLICY_PERSISTENT:
                         if (mac_is_random(device)) {
                                 r = get_mac(device, false, &generated_mac);
-                                if (r == -ENOENT)
+                                if (r == -ENOENT) {
+                                        log_warning_errno(r, "Could not generate persistent MAC address for %s: %m", old_name);
                                         break;
-                                else if (r < 0)
+                                else if (r < 0)
                                         return r;
                                 mac = &generated_mac;
                         }
@@ -448,9 +445,10 @@ int link_config_apply(link_config_ctx *ctx, link_config *config,
                 case MACPOLICY_RANDOM:
                         if (!mac_is_random(device)) {
                                 r = get_mac(device, true, &generated_mac);
-                                if (r == -ENOENT)
+                                if (r == -ENOENT) {
+                                        log_warning_errno(r, "Could not generate random MAC address for %s: %m", old_name);
                                         break;
-                                else if (r < 0)
+                                else if (r < 0)
                                         return r;
                                 mac = &generated_mac;
                         }
@@ -471,7 +469,7 @@ int link_config_apply(link_config_ctx *ctx, link_config *config,
 
 int link_get_driver(link_config_ctx *ctx, struct udev_device *device, char **ret) {
         const char *name;
-        char *driver;
+        char *driver = NULL;
         int r;
 
         name = udev_device_get_sysname(device);