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
This commit is contained in:
Guy Harris 2012-12-29 22:25:46 +00:00
parent 8be92d6af2
commit 592a0fcf04
1 changed files with 11 additions and 4 deletions

View File

@ -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