]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/network/netdev/vrf.c
tree-wide: make sure net/if.h is included before any linux/ header
[thirdparty/systemd.git] / src / network / netdev / vrf.c
index 9f75eb63cf991358853b9273e81504d62b7b25f0..24079a7203c89063a9c2c4bd3a501d2b57c40873 100644 (file)
@@ -1,22 +1,18 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+/* Make sure the net/if.h header is included before any linux/ one */
 #include <net/if.h>
-#include <netinet/in.h>
 #include <linux/if_arp.h>
+#include <netinet/in.h>
 
 #include "vrf.h"
 
 static int netdev_vrf_fill_message_create(NetDev *netdev, Link *link, sd_netlink_message *m) {
-        Vrf *v;
-        int r;
-
-        assert(netdev);
         assert(!link);
         assert(m);
 
-        v = VRF(netdev);
-
-        assert(v);
+        Vrf *v = VRF(netdev);
+        int r;
 
         r = sd_netlink_message_append_u32(m, IFLA_VRF_TABLE, v->table);
         if (r < 0)
@@ -29,7 +25,7 @@ const NetDevVTable vrf_vtable = {
         .object_size = sizeof(Vrf),
         .sections = NETDEV_COMMON_SECTIONS "VRF\0",
         .fill_message_create = netdev_vrf_fill_message_create,
-        .create_type = NETDEV_CREATE_MASTER,
+        .create_type = NETDEV_CREATE_INDEPENDENT,
         .iftype = ARPHRD_ETHER,
         .generate_mac = true,
 };