Trying to use current libnl 3.0 fails since API has changed:
mibII/tcpTable.c: In function 'tcpTable_load_netlink':
mibII/tcpTable.c:559:25: warning: initialization makes pointer from integer without a cast [enabled by default]
mibII/tcpTable.c:567:2: warning: passing argument 1 of 'nl_connect' from incompatible pointer type [enabled by default]
/usr/include/netlink/netlink.h:45:14: note: expected 'struct nl_sock *' but argument is of type 'struct nl_handle *'
mibII/tcpTable.c:569:3: error: too few arguments to function 'nl_geterror'
/usr/include/netlink/errno.h:53:21: note: declared here
mibII/tcpTable.c:582:2: warning: passing argument 1 of 'nl_send_auto_complete' from incompatible pointer type [enabled by default]
/usr/include/netlink/netlink.h:60:14: note: expected 'struct nl_sock *' but argument is of type 'struct nl_handle *'
mibII/tcpTable.c:584:3: error: too few arguments to function 'nl_geterror'
/usr/include/netlink/errno.h:53:21: note: declared here
mibII/tcpTable.c:595:3: warning: passing argument 1 of 'nl_recv' from incompatible pointer type [enabled by default]
/usr/include/netlink/netlink.h:66:14: note: expected 'struct nl_sock *' but argument is of type 'struct nl_handle *'
mibII/tcpTable.c:597:4: error: too few arguments to function 'nl_geterror'
/usr/include/netlink/errno.h:53:21: note: declared here
make[2]: *** [mibII/tcpTable.lo] Error 1
make[2]: Leaving directory `/home/users/arekm/rpm/BUILD/net-snmp-5.6.1/agent/mibgroup'
The bug #3139249 can be closed/ignored now since libnl 3.0 is current.
Also nothe what libnl author says: "This release is supposed to mark the start of the stable era where the API and ABI are kept stable." (http://www.infradead.org/~tgr/libnl/) so it's worth supporting IMO.
libnl 3.0 support
This change solves the build issues for us with libnl 2.X. Can it still be applied against the latest version somehow so that we would be able to build net-snmp againt libnl 2.X?
Thank you in advance
Last edit: Papp Laszlo 2013-09-05
Regarding testing this patch: is there a Linux distro that has already included libnl-3 ? If so, which one ?
Archlinux: https://www.archlinux.org/packages/?q=libnl
OpenEmbedded/Yocto/Poky: http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-support/libnl
Chakra: http://gitorious.org/chakra-packages/core/source/0fbeffe7332b2d7a942079ceb3ffb73e16fefcf9:libnl/PKGBUILD
Actually even debian wheezy (stable), latest Ubuntus, etc... I would rather ask which one not? :-)
My only problem is that I am stuck with a bit older OpenEmbedded/Poky/Yocto, and that is why I need to use libnl 2.X for the time being.
Last edit: Papp Laszlo 2013-09-05
Applying the patch attached to this bug report would break compatibility with libnl-2, isn't it ? I think we need a patch that adds support in ./configure for detecting the libnl version and a patch that works with both libnl-2 and libnl-3.
This change makes libnl 2.X work from the broken state. I do not know if it breaks libnl 3.X. though. Could someone please verify that?
Hmm, actually it seems to work with Archlinux fine as this patch is applied automatically:
https://projects.archlinux.org/svntogit/packages.git/tree/trunk/libnl32.patch?h=packages/net-snmp
Any reason for holding this change more off then rather than integrating into the repository?
Last edit: Papp Laszlo 2013-09-05
Your patch breaks the build on at least openSUSE 12.3:
$ make
[ ... ]
mibII/tcpTable.c: In function 'tcpTable_load_netlink':
mibII/tcpTable.c:595:3: error: too many arguments to function 'nl_geterror'
In file included from /usr/include/netlink/object.h:16:0,
from /usr/include/netlink/msg.h:16,
from mibII/tcpTable.c:35:
/usr/include/netlink/utils.h:41:15: note: declared here
mibII/tcpTable.c:595:3: error: too many arguments to function 'nl_geterror'
In file included from /usr/include/netlink/object.h:16:0,
from /usr/include/netlink/msg.h:16,
from mibII/tcpTable.c:35:
/usr/include/netlink/utils.h:41:15: note: declared here
mibII/tcpTable.c:596:3: error: too many arguments to function 'nl_geterror'
In file included from /usr/include/netlink/object.h:16:0,
from /usr/include/netlink/msg.h:16,
from mibII/tcpTable.c:35:
/usr/include/netlink/utils.h:41:15: note: declared here
mibII/tcpTable.c:597:3: warning: implicit declaration of function 'nl_socket_free' [-Wimplicit-function-declaration]
mibII/tcpTable.c:605:3: error: too many arguments to function 'nl_geterror'
In file included from /usr/include/netlink/object.h:16:0,
from /usr/include/netlink/msg.h:16,
from mibII/tcpTable.c:35:
/usr/include/netlink/utils.h:41:15: note: declared here
mibII/tcpTable.c:605:3: error: too many arguments to function 'nl_geterror'
In file included from /usr/include/netlink/object.h:16:0,
from /usr/include/netlink/msg.h:16,
from mibII/tcpTable.c:35:
/usr/include/netlink/utils.h:41:15: note: declared here
mibII/tcpTable.c:606:3: error: too many arguments to function 'nl_geterror'
In file included from /usr/include/netlink/object.h:16:0,
from /usr/include/netlink/msg.h:16,
from mibII/tcpTable.c:35:
/usr/include/netlink/utils.h:41:15: note: declared here
mibII/tcpTable.c:615:4: error: too many arguments to function 'nl_geterror'
In file included from /usr/include/netlink/object.h:16:0,
from /usr/include/netlink/msg.h:16,
from mibII/tcpTable.c:35:
/usr/include/netlink/utils.h:41:15: note: declared here
mibII/tcpTable.c:615:4: error: too many arguments to function 'nl_geterror'
In file included from /usr/include/netlink/object.h:16:0,
from /usr/include/netlink/msg.h:16,
from mibII/tcpTable.c:35:
/usr/include/netlink/utils.h:41:15: note: declared here
mibII/tcpTable.c:616:4: error: too many arguments to function 'nl_geterror'
In file included from /usr/include/netlink/object.h:16:0,
from /usr/include/netlink/msg.h:16,
from mibII/tcpTable.c:35:
/usr/include/netlink/utils.h:41:15: note: declared here
make[2]: *** [mibII/tcpTable.lo] Error 1
Dear Anonymous, could you please let us know your libnl version?
Last edit: Papp Laszlo 2013-09-05
$ cat /etc/issue.net
Welcome to openSUSE 12.3 "Dartmouth" - Kernel %r (%t).
$ rpm -qf /usr/include/netlink
libnl-1_1-devel-1.1-65.1.2.x86_64
$ rpm -qf /usr/include/libnl3/netlink
libnl3-devel-3.2.16-2.1.1.x86_64
Hmm, not sure why you have two different versions installed in parallel. Which one is used for the building, by the way?
It would be appreciated if you could verify whether patch 0001-Linux-bug-2238-Implement-libnl3-support.patch works for you on top of the Net-SNMP master branch. Please note that since that patch changes the configure script that you will have to rerun ./configure.
.
The above patch has been checked in on the v5.6 and later branches.