GNOME Bugzilla – Bug 692423
avoid #including netlink/object-api.h; libnl-3.2.20 and higher no longer installs it
Last modified: 2013-01-24 19:45:05 UTC
(as reported downstream at https://bugs.gentoo.org/show_bug.cgi?id=453736) libnl-3.2.20 and higher no longer installs object-api.h (see https://github.com/tgraf/libnl/commit/f20bbe1f07fcff1509425884f5ed72ca8d5fb6ab), causing a build failure in nm-netlink-monitor.c which #includes that header. As far as I can tell, there is no good reason why nm-netlink-monitor.c uses object-api.h (considered to be unstable libnl API) instead of object.h; simply replacing "object-api.h" with "object.h" allows networkmanager-0.9.6.4 to build.
Created attachment 234274 [details] [review] trivial patch
I can confirm this. Downgraded libnl to 3.2.14 and then it builds.
yup, builds fine with that change on fedora too. thanks.
It doesn't build against libnl3-devel-3.2.14-1.fc18.x86_64!
Fixed using: commit ff15a5e8fbe2e8e7199d84c96d4b2f3c60cb8550 Author: Pavel Šimerda <psimerda@redhat.com> Date: Thu Jan 24 20:40:25 2013 +0100 netlink: workaround to build against libnl3 < 3.2.20 Commit 418a428 fixed building against libnl3 >= 3.2.20 but due to a bug in libnl it also prevents building against libnl3 < 3.2.20. See https://bugzilla.gnome.org/show_bug.cgi?id=692423 diff --git a/src/nm-netlink-monitor.c b/src/nm-netlink-monitor.c index 5bbf500..4d0b0c5 100644 --- a/src/nm-netlink-monitor.c +++ b/src/nm-netlink-monitor.c @@ -38,6 +38,10 @@ #include <linux/if.h> #include <linux/unistd.h> #include <unistd.h> +#include <netlink/version.h> +#if LIBNL_VER_NUM == LIBNL_VER (3, 2) && LIBNL_VER_MIC < 20 +#include <netlink/object-api.h> +#endif #include <netlink/object.h> #include <netlink/route/addr.h> #include <netlink/route/rtnl.h>