1ff636
From eceb99d70a7c0916cb626dfbcb50894e1f4e9431 Mon Sep 17 00:00:00 2001
1ff636
From: Michael Olbrich <m.olbrich@pengutronix.de>
1ff636
Date: Mon, 9 Mar 2015 12:27:25 +0100
1ff636
Subject: [PATCH] missing.h: add NDA_*
1ff636
1ff636
This is necessary to build with older kernel headers. NDA_VLAN was
1ff636
introduced in v3.9 and NDA_PORT, NDA_VNI and NDA_IFINDEX in v3.10
1ff636
1ff636
(cherry picked from commit cf1755bac0426132c21fdca519a336ce7d920277)
1ff636
---
1ff636
 configure.ac         |  4 +++-
1ff636
 src/shared/missing.h | 16 ++++++++++++++++
1ff636
 2 files changed, 19 insertions(+), 1 deletion(-)
1ff636
1ff636
diff --git a/configure.ac b/configure.ac
1ff636
index 3201428..081ed0f 100644
1ff636
--- a/configure.ac
1ff636
+++ b/configure.ac
1ff636
@@ -334,7 +334,8 @@ AC_CHECK_DECLS([IFLA_INET6_ADDR_GEN_MODE,
1ff636
                 IFLA_VXLAN_LOCAL6,
1ff636
                 IFLA_IPTUN_6RD_RELAY_PREFIXLEN,
1ff636
                 IFLA_BRIDGE_VLAN_INFO,
1ff636
-                IFLA_BRPORT_UNICAST_FLOOD],
1ff636
+                IFLA_BRPORT_UNICAST_FLOOD,
1ff636
+                NDA_IFINDEX],
1ff636
 [], [], [[
1ff636
 #include <inttypes.h>
1ff636
 #include <netinet/in.h>
1ff636
@@ -345,6 +346,7 @@ AC_CHECK_DECLS([IFLA_INET6_ADDR_GEN_MODE,
1ff636
 #include <linux/if_tunnel.h>
1ff636
 #include <linux/if_link.h>
1ff636
 #include <linux/if_bridge.h>
1ff636
+#include <linux/neighbour.h>
1ff636
 ]])
1ff636
 
1ff636
 # This makes sure pkg.m4 is available.
1ff636
diff --git a/src/shared/missing.h b/src/shared/missing.h
1ff636
index 8cb0b2c..6ef4dbd 100644
1ff636
--- a/src/shared/missing.h
1ff636
+++ b/src/shared/missing.h
1ff636
@@ -35,6 +35,7 @@
1ff636
 #include <linux/loop.h>
1ff636
 #include <linux/audit.h>
1ff636
 #include <linux/capability.h>
1ff636
+#include <linux/neighbour.h>
1ff636
 
1ff636
 #ifdef HAVE_AUDIT
1ff636
 #include <libaudit.h>
1ff636
@@ -687,6 +688,21 @@ static inline int setns(int fd, int nstype) {
1ff636
 #define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1)
1ff636
 #endif
1ff636
 
1ff636
+#if !HAVE_DECL_NDA_IFINDEX
1ff636
+#define NDA_UNSPEC 0
1ff636
+#define NDA_DST 1
1ff636
+#define NDA_LLADDR 2
1ff636
+#define NDA_CACHEINFO 3
1ff636
+#define NDA_PROBES 4
1ff636
+#define NDA_VLAN 5
1ff636
+#define NDA_PORT 6
1ff636
+#define NDA_VNI 7
1ff636
+#define NDA_IFINDEX 8
1ff636
+#define __NDA_MAX 9
1ff636
+
1ff636
+#define NDA_MAX (__NDA_MAX - 1)
1ff636
+#endif
1ff636
+
1ff636
 #ifndef IPV6_UNICAST_IF
1ff636
 #define IPV6_UNICAST_IF 76
1ff636
 #endif