[systemd-commits] 5 commits - src/libsystemd src/network src/udev

Tom Gundersen tomegun at kemper.freedesktop.org
Mon Dec 8 09:39:01 PST 2014


 src/libsystemd/sd-rtnl/rtnl-message.c |    5 +++--
 src/network/networkd-link.c           |    2 +-
 src/network/networkd-network.c        |   11 ++++++-----
 src/network/networkd-route.c          |    8 +++++++-
 src/udev/net/link-config.c            |   21 ++++++++-------------
 5 files changed, 25 insertions(+), 22 deletions(-)

New commits:
commit 1e19f35297ee757095cf372c82c3d9a6bb2311d3
Author: Tom Gundersen <teg at jklm.no>
Date:   Mon Dec 8 18:36:49 2014 +0100

    networkd: link - typo

diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index d59a819..4ad0bb4 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -1447,7 +1447,7 @@ int link_rtnl_process_address(sd_rtnl *rtnl, sd_rtnl_message *message,
         } else {
                 r = link_get(m, ifindex, &link);
                 if (r < 0 || !link) {
-                        log_warning("rtnl: received address for a nonexistent link (%d), ignoring", ifindex);
+                        log_warning("rtnl: received address for nonexistent link (%d), ignoring", ifindex);
                         return 0;
                 }
         }

commit 0e707326fcecd3968efa7dc827123032f1b2cb61
Author: Tom Gundersen <teg at jklm.no>
Date:   Mon Dec 8 18:36:16 2014 +0100

    sd-rtnl: fix bogus warning about dropping 20 bytes from multi-part messages
    
    Nothing was being dropped, we just failed to account for the NLMSG_DONE.

diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c
index 1112aa6..ac920b2 100644
--- a/src/libsystemd/sd-rtnl/rtnl-message.c
+++ b/src/libsystemd/sd-rtnl/rtnl-message.c
@@ -1380,7 +1380,7 @@ int socket_read_message(sd_rtnl *rtnl) {
                 }
         }
 
-        for (new_msg = rtnl->rbuffer; NLMSG_OK(new_msg, len); new_msg = NLMSG_NEXT(new_msg, len)) {
+        for (new_msg = rtnl->rbuffer; NLMSG_OK(new_msg, len) && !done; new_msg = NLMSG_NEXT(new_msg, len)) {
                 _cleanup_rtnl_message_unref_ sd_rtnl_message *m = NULL;
                 const NLType *nl_type;
 
@@ -1395,7 +1395,8 @@ int socket_read_message(sd_rtnl *rtnl) {
                 if (new_msg->nlmsg_type == NLMSG_DONE) {
                         /* finished reading multi-part message */
                         done = true;
-                        break;
+
+                        continue;
                 }
 
                 /* check that we support this message type */

commit 935c0d26f7ca748e78a02f524908ede696dc4cda
Author: Tom Gundersen <teg at jklm.no>
Date:   Mon Dec 8 13:58:48 2014 +0100

    networkd: route - ignore unknown address family

diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c
index 4e389db..590dd49 100644
--- a/src/network/networkd-route.c
+++ b/src/network/networkd-route.c
@@ -353,6 +353,12 @@ int config_parse_destination(const char *unit,
                 return 0;
         }
 
+        if (f != AF_INET && f != AF_INET6) {
+                log_syntax(unit, LOG_ERR, filename, line, EINVAL,
+                           "Unknown address family, ignoring assignment: %s", address);
+                return 0;
+        }
+
         /* prefixlen */
         if (e) {
                 r = safe_atou8(e + 1, &prefixlen);
@@ -362,7 +368,7 @@ int config_parse_destination(const char *unit,
                         return 0;
                 }
         } else {
-                switch (n->family) {
+                switch (f) {
                         case AF_INET:
                                 prefixlen = 32;
                                 break;

commit ca6038b89645c0c1bd547d6a420bf95eb3d6f4cc
Author: Tom Gundersen <teg at jklm.no>
Date:   Sun Dec 7 13:00:01 2014 +0100

    udev: link-config - simplify net-match

diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
index 75cc7d2..075596a 100644
--- a/src/network/networkd-network.c
+++ b/src/network/networkd-network.c
@@ -226,16 +226,16 @@ int network_get(Manager *manager, struct udev_device *device,
                                      udev_device_get_property_value(device, "ID_NET_DRIVER"),
                                      udev_device_get_devtype(device),
                                      ifname)) {
-                        const char *attr;
-                        uint8_t name_assign_type = NET_NAME_UNKNOWN;
-
                         if (network->match_name) {
+                                const char *attr;
+                                uint8_t name_assign_type = NET_NAME_UNKNOWN;
+
                                 attr = udev_device_get_sysattr_value(device, "name_assign_type");
                                 if (attr)
                                         (void)safe_atou8(attr, &name_assign_type);
 
                                 if (name_assign_type == NET_NAME_ENUM)
-                                        log_warning("%-*s: found matching network '%s', based on potentially unstable ifname",
+                                        log_warning("%-*s: found matching network '%s', based on potentially unpredictable ifname",
                                                     IFNAMSIZ, ifname, network->filename);
                                 else
                                         log_debug("%-*s: found matching network '%s'", IFNAMSIZ, ifname, network->filename);
diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c
index 8123250..bf24f6a 100644
--- a/src/udev/net/link-config.c
+++ b/src/udev/net/link-config.c
@@ -246,7 +246,7 @@ int link_config_get(link_config_ctx *ctx, struct udev_device *device,
                                         (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 unstable interface name '%s'",
+                                        log_warning("Config file %s applies to device based on potentially unpredictable interface name '%s'",
                                                   link->filename, udev_device_get_sysname(device));
                                         *ret = link;
 
@@ -254,22 +254,17 @@ int link_config_get(link_config_ctx *ctx, struct udev_device *device,
                                 } else if (name_assign_type == NET_NAME_RENAMED) {
                                         log_warning("Config file %s matches device based on renamed interface name '%s', ignoring",
                                                   link->filename, udev_device_get_sysname(device));
-                                } else {
-                                        log_debug("Config file %s applies to device %s",
-                                                  link->filename, udev_device_get_sysname(device));
-
-                                        *ret = link;
 
-                                        return 0;
+                                        continue;
                                 }
-                        } else {
-                                log_debug("Config file %s applies to device %s",
-                                          link->filename,  udev_device_get_sysname(device));
+                        }
 
-                                *ret = link;
+                        log_debug("Config file %s applies to device %s",
+                                  link->filename,  udev_device_get_sysname(device));
 
-                                return 0;
-                        }
+                        *ret = link;
+
+                        return 0;
                 }
         }
 

commit 285760fedfaf907deab967b4b071d20e146752b5
Author: Dave Reisner <dreisner at archlinux.org>
Date:   Sat Dec 6 13:34:27 2014 -0500

    Check return value from reading name_assign_type attr
    
    This file won't exist on kernels earlier than 3.17.

diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
index bbc6475..75cc7d2 100644
--- a/src/network/networkd-network.c
+++ b/src/network/networkd-network.c
@@ -231,7 +231,8 @@ int network_get(Manager *manager, struct udev_device *device,
 
                         if (network->match_name) {
                                 attr = udev_device_get_sysattr_value(device, "name_assign_type");
-                                (void)safe_atou8(attr, &name_assign_type);
+                                if (attr)
+                                        (void)safe_atou8(attr, &name_assign_type);
 
                                 if (name_assign_type == NET_NAME_ENUM)
                                         log_warning("%-*s: found matching network '%s', based on potentially unstable ifname",



More information about the systemd-commits mailing list