diff options
author | Guy Harris <guy@alum.mit.edu> | 2012-12-29 22:25:46 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2012-12-29 22:25:46 +0000 |
commit | 592a0fcf04c3f7f9f23476525877763303a1a87d (patch) | |
tree | f1b6a7018bb3fabcb0695379d8de4d2e55660c63 /iface_monitor.c | |
parent | 8be92d6af27dcfcddb4dde6889a62920e0866153 (diff) | |
download | wireshark-592a0fcf04c3f7f9f23476525877763303a1a87d.tar.gz |
OK, try including <net/if.h> iff IFF_UP isn't already defined; see if
that includes it if we need it, but doesn't include it if we don't,
regardless of what versions (plural!) of libnetlink are present.
svn path=/trunk/; revision=46853
Diffstat (limited to 'iface_monitor.c')
-rw-r--r-- | iface_monitor.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/iface_monitor.c b/iface_monitor.c index 6a1dc6ef46..e9143f2dd2 100644 --- a/iface_monitor.c +++ b/iface_monitor.c @@ -37,14 +37,21 @@ #include <strings.h> #include <errno.h> -#if defined(HAVE_LIBNL1) || defined(HAVE_LIBNL2) || defined(HAVE_LIBNL3) -#include <net/if.h> -#endif - #include <netlink/msg.h> #include <netlink/attr.h> #include <netlink/route/link.h> +#ifndef IFF_UP +/* + * Apparently, some versions of libnl drag in headers that define IFF_UP + * and others don't. Include <net/if.h> iff IFF_UP isn't already defined, + * so that if <linux/if.h> has been included by some or all of the + * netlink headers, we don't include <net/if.h> and get a bunch of + * complaints about various structures being redefined. + */ +#include <net/if.h> +#endif + /* libnl 1.x compatibility code */ #ifdef HAVE_LIBNL1 #define nl_sock nl_handle |