[PATCH] veth: add upstream header for VETH defines

Dan Williams dcbw at redhat.com
Fri Jul 25 12:27:09 PDT 2014


Similar to what's done with <linux/if_link.h>, make sure used defines
actually exist.  Otherwise building on even slightly older kernels
fails.

Signed-off-by: Dan Williams <dcbw at redhat.com>
---
 include/linux/veth.h  | 12 ++++++++++++
 lib/route/link/veth.c |  1 +
 2 files changed, 13 insertions(+)
 create mode 100644 include/linux/veth.h

diff --git a/include/linux/veth.h b/include/linux/veth.h
new file mode 100644
index 0000000..3354c1e
--- /dev/null
+++ b/include/linux/veth.h
@@ -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
diff --git a/lib/route/link/veth.c b/lib/route/link/veth.c
index e7e4a26..1c5b125 100644
--- a/lib/route/link/veth.c
+++ b/lib/route/link/veth.c
@@ -28,14 +28,15 @@
 #include <netlink/utils.h>
 #include <netlink/object.h>
 #include <netlink/route/rtnl.h>
 #include <netlink-private/route/link/api.h>
 #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) },
 };
 
 static int veth_parse(struct rtnl_link *link, struct nlattr *data,
 		      struct nlattr *xstats)
-- 
1.9.3





More information about the libnl mailing list