summaryrefslogtreecommitdiff
path: root/proto_nlmsg.c
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2015-06-29 11:27:28 +0200
committerTobias Klauser <tklauser@distanz.ch>2015-06-29 11:33:40 +0200
commitc7d92d93ff8d942db93680655275ec1c60754b98 (patch)
tree4e8c2fc880573668ec8ba1a773082948ef3cbb81 /proto_nlmsg.c
parent382bc0047d33ada5f4b33cab077aa369eb9cb7f7 (diff)
netsniff-ng: nlmsg: Define NTF_* constants if not provided by kernel headers
NTF_SELF and NTF_MASTER might not be defined on older kernel versions (as is e.g. the case in the Travis CI build failing [1]). Fix this by conditionally defining all NTF_* constants. [1] https://travis-ci.org/netsniff-ng/netsniff-ng/jobs/68779130 Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Diffstat (limited to 'proto_nlmsg.c')
-rw-r--r--proto_nlmsg.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/proto_nlmsg.c b/proto_nlmsg.c
index 44ef328..22d50a8 100644
--- a/proto_nlmsg.c
+++ b/proto_nlmsg.c
@@ -584,14 +584,32 @@ static struct flag_name neigh_states[] = {
{ NULL, 0 },
};
+/* Copied from linux/neighbour.h */
+#ifndef NTF_USE
+# define NTF_USE 0x01
+#endif
+#ifndef NTF_SELF
+# define NTF_SELF 0x02
+#endif
+#ifndef NTF_MASTER
+# define NTF_MASTER 0x04
+#endif
+#ifndef NTF_PROXY
+# define NTF_PROXY 0x08
+#endif
+#ifndef NTF_EXT_LEARNED
+# define NTF_EXT_LEARNED 0x10
+#endif
+#ifndef NTF_ROUTER
+# define NTF_ROUTER 0x80
+#endif
+
static struct flag_name neigh_flags[] = {
{ "use", NTF_USE },
{ "self", NTF_SELF },
{ "master", NTF_MASTER },
{ "proxy", NTF_PROXY },
-#ifdef NTF_EXT_LEARNED
{ "ext learned", NTF_EXT_LEARNED },
-#endif
{ "router", NTF_ROUTER },
{ NULL, 0 },
};