core: add libnl-3 API compatibility
This commit is contained in:

committed by
Dan Williams

parent
a6c6556831
commit
daeb181fa2
@@ -331,6 +331,15 @@ if (test "${have_libnl2}" = "yes"); then
|
||||
have_libnl="yes"
|
||||
fi
|
||||
|
||||
PKG_CHECK_MODULES(LIBNL3, libnl-3.0, [have_libnl2=yes], [have_libnl2=no])
|
||||
if (test "${have_libnl2}" = "yes"); then
|
||||
AC_DEFINE(HAVE_LIBNL3, 1, [Define if you require specific libnl-3 support])
|
||||
LIBNL_CFLAGS="$LIBNL3_CFLAGS"
|
||||
LIBNL_LIBS="$LIBNL3_LIBS"
|
||||
libnl_version="3"
|
||||
have_libnl="yes"
|
||||
fi
|
||||
|
||||
if (test "${have_libnl}" = "no"); then
|
||||
AC_MSG_ERROR([libnl development header are required])
|
||||
fi
|
||||
|
@@ -51,6 +51,13 @@ int rtnl_route_get_dst_len(struct rtnl_route *);
|
||||
struct nl_addr * rtnl_route_get_gateway(struct rtnl_route *);
|
||||
#endif
|
||||
|
||||
/* libnl-2 API compatibility for libnl-3 */
|
||||
#ifdef HAVE_LIBNL3
|
||||
static inline int __rtnl_link_alloc_cache(struct nl_sock *h, struct nl_cache **cache) {
|
||||
return rtnl_link_alloc_cache (h, AF_UNSPEC, cache);
|
||||
}
|
||||
#define rtnl_link_alloc_cache __rtnl_link_alloc_cache
|
||||
#endif
|
||||
|
||||
/* libnl-1.0 compat functions */
|
||||
#ifdef HAVE_LIBNL1
|
||||
|
Reference in New Issue
Block a user