From c7d92d93ff8d942db93680655275ec1c60754b98 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Mon, 29 Jun 2015 11:27:28 +0200 Subject: 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 --- proto_nlmsg.c | 22 ++++++++++++++++++++-- 1 file 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 }, }; -- cgit v1.2.3-54-g00ecf