[systemd-commits] 2 commits - src/network

Tom Gundersen tomegun at kemper.freedesktop.org
Fri Jun 20 04:13:16 PDT 2014


 src/network/networkd-link.c   |    2 +-
 src/network/networkd-netdev.c |   21 +++++++++++----------
 2 files changed, 12 insertions(+), 11 deletions(-)

New commits:
commit 6b66097b9534da434cdb56d22c49452cfc0dcaf1
Author: Tom Gundersen <teg at jklm.no>
Date:   Fri Jun 20 13:04:02 2014 +0200

    networkd: link - fix memleak of icmp6 struct

diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index 664cc07..44147b2 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -124,8 +124,8 @@ static void link_free(Link *link) {
         free(link->lease_file);
 
         sd_ipv4ll_unref(link->ipv4ll);
-
         sd_dhcp6_client_unref(link->dhcp6_client);
+        sd_icmp6_nd_unref(link->icmp6_router_discovery);
 
         hashmap_remove(link->manager->links, &link->ifindex);
 

commit 6278a2019055ba63bfa80c2b107e16616ca648b1
Author: Tom Gundersen <teg at jklm.no>
Date:   Fri Jun 20 12:59:22 2014 +0200

    networkd: veth - fix creation of veth netdev
    
    Avoid freeing the netdev structure in the cleanup macro.

diff --git a/src/network/networkd-netdev.c b/src/network/networkd-netdev.c
index 016daf3..dcf7596 100644
--- a/src/network/networkd-netdev.c
+++ b/src/network/networkd-netdev.c
@@ -691,7 +691,8 @@ static int netdev_load_one(Manager *manager, const char *filename) {
 
         LIST_HEAD_INIT(netdev->callbacks);
 
-        if(netdev->kind == NETDEV_KIND_VETH) {
+        switch (netdev->kind) {
+        case NETDEV_KIND_VETH:
                 if (!netdev->ifname_peer) {
                         log_warning("Veth NetDev without peer name configured "
                                     "in %s. Ignoring", filename);
@@ -707,19 +708,19 @@ static int netdev_load_one(Manager *manager, const char *filename) {
                         }
                 }
 
-                return netdev_create_veth(netdev, netdev_create_handler);
-        }
+                r = netdev_create_veth(netdev, netdev_create_handler);
+                if (r < 0)
+                        return r;
 
-        if (netdev->kind != NETDEV_KIND_VLAN &&
-            netdev->kind != NETDEV_KIND_MACVLAN &&
-            netdev->kind != NETDEV_KIND_VXLAN &&
-            netdev->kind != NETDEV_KIND_IPIP &&
-            netdev->kind != NETDEV_KIND_GRE &&
-            netdev->kind != NETDEV_KIND_SIT &&
-            netdev->kind != NETDEV_KIND_VTI) {
+                break;
+        case NETDEV_KIND_BRIDGE:
+        case NETDEV_KIND_BOND:
                 r = netdev_create(netdev, NULL, NULL);
                 if (r < 0)
                         return r;
+                break;
+        default:
+                break;
         }
 
         log_debug_netdev(netdev, "loaded %s", netdev_kind_to_string(netdev->kind));



More information about the systemd-commits mailing list