After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 692423 - avoid #including netlink/object-api.h; libnl-3.2.20 and higher no longer installs it
avoid #including netlink/object-api.h; libnl-3.2.20 and higher no longer inst...
Status: RESOLVED FIXED
Product: NetworkManager
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: NetworkManager maintainer(s)
NetworkManager maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-01-24 04:10 UTC by Alexandre Rostovtsev
Modified: 2013-01-24 19:45 UTC
See Also:
GNOME target: ---
GNOME version: 3.5/3.6


Attachments
trivial patch (787 bytes, patch)
2013-01-24 04:12 UTC, Alexandre Rostovtsev
committed Details | Review

Description Alexandre Rostovtsev 2013-01-24 04:10:04 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.
Comment 1 Alexandre Rostovtsev 2013-01-24 04:12:32 UTC
Created attachment 234274 [details] [review]
trivial patch
Comment 2 Fredrik Elestedt 2013-01-24 12:42:47 UTC
I can confirm this. Downgraded libnl to 3.2.14 and then it builds.
Comment 3 Dan Winship 2013-01-24 14:33:41 UTC
yup, builds fine with that change on fedora too. thanks.
Comment 4 Pavel Simerda 2013-01-24 19:17:52 UTC
It doesn't build against libnl3-devel-3.2.14-1.fc18.x86_64!
Comment 5 Pavel Simerda 2013-01-24 19:45:05 UTC
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>