]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/network/netdev/l2tp-tunnel.c
network: include glibc headers before including kernel headers
[thirdparty/systemd.git] / src / network / netdev / l2tp-tunnel.c
index c78b19ce93c294c2ad5a2494d5085c9145bfba8f..6ac23052bb3ce94ed37a6ba4852ac62869d63468 100644 (file)
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1+ */
 
-#include <arpa/inet.h>
+#include <netinet/in.h>
 #include <linux/l2tp.h>
 #include <linux/genetlink.h>
 
@@ -629,9 +629,9 @@ int config_parse_l2tp_session_name(
                 return 0;
         }
 
-        session->name = strdup(rvalue);
-        if (!session->name)
-                return -ENOMEM;
+        r = free_and_strdup(&session->name, rvalue);
+        if (r < 0)
+                return log_oom();
 
         session = NULL;
         return 0;
@@ -726,7 +726,7 @@ static void l2tp_tunnel_done(NetDev *netdev) {
 const NetDevVTable l2tptnl_vtable = {
         .object_size = sizeof(L2tpTunnel),
         .init = l2tp_tunnel_init,
-        .sections = "Match\0NetDev\0L2TP\0L2TPSession",
+        .sections = "Match\0NetDev\0L2TP\0L2TPSession\0",
         .create_after_configured = l2tp_create_tunnel,
         .done = l2tp_tunnel_done,
         .create_type = NETDEV_CREATE_AFTER_CONFIGURED,