]> granicus.if.org Git - libnl/commitdiff
veth: add kernel header linux/veth.h for VETH defines
authorDan Williams <dcbw@redhat.com>
Fri, 25 Jul 2014 19:27:09 +0000 (14:27 -0500)
committerThomas Haller <thaller@redhat.com>
Fri, 25 Jul 2014 20:37:41 +0000 (22:37 +0200)
Similar to what's done with <linux/if_link.h>, make sure used defines
actually exist.  Otherwise building on even slightly older kernels
fails.

Taken from upstream kernel commit 1860e379875dfe7271c649058aeddffe5afd9d0d
(tag: v3.15), file 'include/uapi/linux/veth.h'.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
include/linux/if_link.h
include/linux/veth.h [new file with mode: 0644]
lib/route/link/veth.c

index 8b8493942e50f717e7add6b50df052b52dbb4117..8119dc2582d66d8cc2515e0bbe4dfa6b29ed5d8f 100644 (file)
@@ -313,14 +313,6 @@ struct ifla_vxlan_port_range {
        __be16  high;
 };
 
-enum {
-       VETH_INFO_UNSPEC,
-       VETH_INFO_PEER,
-
-       __VETH_INFO_MAX
-#define VETH_INFO_MAX   (__VETH_INFO_MAX - 1)
-};
-
 /* SR-IOV virtual function management section */
 
 enum {
diff --git a/include/linux/veth.h b/include/linux/veth.h
new file mode 100644 (file)
index 0000000..3354c1e
--- /dev/null
@@ -0,0 +1,12 @@
+#ifndef __NET_VETH_H_
+#define __NET_VETH_H_
+
+enum {
+       VETH_INFO_UNSPEC,
+       VETH_INFO_PEER,
+
+       __VETH_INFO_MAX
+#define VETH_INFO_MAX  (__VETH_INFO_MAX - 1)
+};
+
+#endif
index e7e4a268364ea593f72e9bbae757b0b531011f7a..1c5b12584339c92923dc8f9ca4923e4f498057ed 100644 (file)
@@ -32,6 +32,7 @@
 #include <netlink/route/link/veth.h>
 
 #include <linux/if_link.h>
+#include <linux/veth.h>
 
 static struct nla_policy veth_policy[VETH_INFO_MAX+1] = {
        [VETH_INFO_PEER]        = { .minlen = sizeof(struct ifinfomsg) },