chiark / gitweb /
link-config: Fix typo in log_warning
[elogind.git] / src / udev / net / link-config.c
index d930afcc0753295e0b4650f841be0ac4cb86ec0b..5156ba6f8ad781c9fde6fae47a4ecad1d297c57b 100644 (file)
@@ -169,11 +169,10 @@ static int load_link(link_config_ctx *ctx, const char *filename) {
         link->wol = _WOL_INVALID;
         link->duplex = _DUP_INVALID;
 
-
         r = config_parse(NULL, filename, file, "Match\0Link\0Ethernet\0", config_item_perf_lookup,
                          (void*) link_config_gperf_lookup, false, false, link);
         if (r < 0) {
-                log_warning("Colud not parse config file %s: %s", filename, strerror(-r));
+                log_warning("Could not parse config file %s: %s", filename, strerror(-r));
                 goto failure;
         } else
                 log_debug("Parsed configuration file %s", filename);
@@ -195,14 +194,14 @@ static bool enable_name_policy(void) {
         int r;
         size_t l;
 
-        r = read_one_line_file("/proc/cmdline", &line);
-        if (r < 0) {
+        r = proc_cmdline(&line);
+        if (r < 0)
                 log_warning("Failed to read /proc/cmdline, ignoring: %s", strerror(-r));
-                return true; /* something is very wrong, let's not make it worse */
-        }
+        if (r <= 0)
+                return true;
 
         FOREACH_WORD_QUOTED(w, l, line, state)
-                if (strneq(w, "net.ifnames=0", l))
+                if (l == sizeof("net.ifnames=0") - 1 && strneq(w, "net.ifnames=0", l))
                         return false;
 
         return true;
@@ -245,9 +244,14 @@ int link_config_get(link_config_ctx *ctx, struct udev_device *device, link_confi
         link_config *link;
 
         LIST_FOREACH(links, link, ctx->links) {
+
                 if (net_match_config(link->match_mac, link->match_path,
-                                     link->match_driver, link->match_type,
-                                     NULL, device)) {
+                                     link->match_driver, link->match_type, NULL,
+                                     udev_device_get_sysattr_value(device, "address"),
+                                     udev_device_get_property_value(device, "ID_PATH"),
+                                     udev_device_get_driver(device),
+                                     udev_device_get_devtype(device),
+                                     NULL)) {
                         log_debug("Config file %s applies to device %s",
                                   link->filename,
                                   udev_device_get_sysname(device));