X-Git-Url: http://git.onelab.eu/?p=util-vserver-pl.git;a=blobdiff_plain;f=src%2Fvip6-autod.c;h=ab03cf5777e40420bf8f09bd1e7ce01b533090d1;hp=75055c1eca7def18aa215891d94f5c0dfc4da2ca;hb=11c3a2d86a22a68c404ec711bd7b859ad123c784;hpb=8031466ca085072b4bae958ddba3c422d80b1ffc diff --git a/src/vip6-autod.c b/src/vip6-autod.c index 75055c1..ab03cf5 100644 --- a/src/vip6-autod.c +++ b/src/vip6-autod.c @@ -29,7 +29,11 @@ #include #include -#include +#if defined(HAVE_LIBNL_1_1) +# include +#elif defined(HAVE_LIBNL_1_0) +# define rtnl_addr_put rtnl_addr_free +#endif #include #include @@ -596,16 +600,22 @@ int main(int argc, char *argv[]) openlog("vip6-autod", LOG_PERROR, LOG_DAEMON); +#if defined(HAVE_LIBNL_1_1) cbs = nl_cb_alloc(NL_CB_VERBOSE); if (!cbs) { syslog(LOG_CRIT, "nl_cb_alloc: %s", strerror(errno)); exit(1); } +#elif defined(HAVE_LIBNL_1_0) + handle = nl_handle_alloc_nondefault(NL_CB_VERBOSE); + cbs = nl_handle_get_cb(handle); +#endif nl_cb_set(cbs, NL_CB_VALID, NL_CB_CUSTOM, handle_valid_msg, &map); nl_cb_set(cbs, NL_CB_SEQ_CHECK, NL_CB_CUSTOM, handle_no_op, NULL); nl_cb_err(cbs, NL_CB_CUSTOM, handle_error_msg, &map); - +#ifdef HAVE_LIBNL_1_1 handle = nl_handle_alloc_cb(cbs); +#endif nl_disable_sequence_check(handle); nl_join_groups(handle, RTMGRP_IPV6_PREFIX|RTMGRP_IPV6_IFADDR);