dect
/
libnl
Archived
13
0
Fork 0
Commit Graph

467 Commits

Author SHA1 Message Date
Thomas Graf 183e86913a doc: Check documentation generation requirements with autoconf
Adds --enable-doc/--disable-doc, if omitted doc will only be build
if requirements are met. If explicitely enabled, configure script
will fail if requirements are not met.
2012-05-09 10:06:24 +02:00
Adrian Ban 7b503a12a0 u32: example/test code for u32 hashing with HTB 2012-05-08 23:17:53 +02:00
Adrian Ban beb40e2b4e u32: add support for hashing 2012-05-08 23:14:13 +02:00
Thomas Graf f8b4f9271b 3.2.9 release 2012-05-08 22:53:26 +02:00
Thomas Graf 6f156a7b58 nl: Fix return value of nl_recvmsgs()
Apparently the change to have nl_recvmsgs() return the number of
parsed messages broke nl_wait_for_ack() among other applications.

This patch reverts to the old behaviour and provides a new function
nl_recvmsgs_report() which provides the additional information for
use by the cache manager and possibly other applications.

Reported-by: Scott Bonar <sbonar@cradlepoint.com>
Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-05-08 22:48:00 +02:00
Jeroen Roovers d726ecd2d7 Fix two bugs in 3.2.8/doc/
doc/Doxyfile.in:
  Refer to @top_srcdir@ instead of @src_dir@
doc/Makefile.in:
  Set .PHONY to api_ref instead of api_refs

http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-libs/libnl/files/

Cheers,
     jer
2012-05-07 14:54:42 +02:00
Thomas Graf ad5d2b7738 3.2.8 release 2012-04-26 11:22:49 +02:00
Thomas Graf ff3e9e314c object: Add functions to access the object type, cache and object ops 2012-04-24 14:55:23 +02:00
Thomas Graf bd1e4d0384 cache: Add co_include_event allowing caches to provide their own nl_cache_include() implementation 2012-04-22 15:23:52 +02:00
Thomas Graf 2e23491c50 cache: improve documentation of co_event_filter 2012-04-22 14:36:01 +02:00
Thomas Graf 8bbcd2208e genl: Make genl_unregister() a NOP if NULL pointer is passed 2012-04-22 11:12:01 +02:00
Thomas Graf 2e93940a86 cache_mngr: Make providing the result pointer to nl_cache_mngr_add() optional 2012-04-21 15:51:43 +02:00
Thomas Graf 2ed371eb59 test-cache-mngr: Allow for management of arbitary caches via argument string
Let the user specify a list of cache types to add to the manager
as arguments instead of adding a static list.

Uses the newly added nl_cache_mngr_info() to constantly print
information about the manager.
2012-04-21 15:49:09 +02:00
Thomas Graf 516536625f cache_mngr: Provide nl_cache_mngr_info() to pring cache manager details
Useful for debugging and testing
2012-04-21 15:48:37 +02:00
Thomas Graf 743756f3b4 cache_mngr: API doc updates 2012-04-21 15:22:04 +02:00
Thomas Graf a518a318d4 cache_mngr: Let nl_cache_mngr_data_ready() read multiple messages
Having nl_recvmsgs() return the number of read messages allows
to continue reading until the underlying recvmsg() will return
EAGAIN for the non blocking socket.
2012-04-21 12:47:29 +02:00
Thomas Graf e0482794a8 nl: Make nl_recvmsgs() return the number of netlink messages processed 2012-04-21 12:46:01 +02:00
Thomas Graf adbc568735 cache_mngr: Fix memory corruption after resizing
The reallocated part of the enlarged association array was left
uninitialized which would have resulted in trying to free random
pointers.

This was a theoretical bug because it wasn't possible to register
more than 32 cache types since no netlink family supports that
many individual cache types.

Nevertheless this patch fixes the bug and also reduces the default
size of the allocation table and expandations a bit to reduce the
memory footprint slightly.
2012-04-21 12:23:38 +02:00
Thomas Graf a143037fa3 test-cache-mngr: Let the cache manager allocate the socket 2012-04-21 12:14:11 +02:00
Thomas Graf e34ed950bd cache_mngr: Automatically allocate socket if needed
The requirement to have the caller provide the socket does not
make much sense. Automatically allocate the socket if none was
provided.

This may also avoid some future abuse of reusing request sockets
for handling notifications.

Also rename cm_handle to cm_sock for clarity (no API change)
2012-04-21 12:11:45 +02:00
Thomas Graf c55acc438b cache_manager: Move documentation to doc/core.txt 2012-04-21 11:38:33 +02:00
Thomas Graf b32011254d cache_mngr: Don't modify callback setup of socket
Instead, clone it and modify a temporary copy. Although it is not
recommended to use the same socket for requests and to serve a
cache manager, this change might prevent some unwanted side effects
if done so.
2012-04-21 10:51:34 +02:00
Thomas Graf e78975aea8 tests: fix test programs to compile again 2012-04-21 10:35:20 +02:00
Thomas Graf 9af5469004 tests: Convert tests/Makefile to use automake 2012-04-21 10:34:43 +02:00
Thomas Graf 653ea3457a cache_mngr: document uncommon error codes 2012-04-21 09:59:26 +02:00
Thomas Graf 5f4d4d3bec genl-ctrl-list: Mark for installation 2012-04-20 15:28:48 +02:00
Thomas Graf 4a2962d897 genl-ctrl-list: fix copyright and summary 2012-04-20 15:27:52 +02:00
Thomas Graf 5399b3d192 genl-ctrl-list: Provide manual page 2012-04-20 15:19:41 +02:00
Thomas Graf 073ef6a66e genl-ctrl-list: Introduce -d|--details as a shortcut for --format=details 2012-04-20 15:18:21 +02:00
Nicolas CARRIER f54ac3d55f Memory leak in classid.c
I'm using libnl in a program which I give to valgrind
in order to track memory errors / leaks. When my program
exits, it complains about non-freed memory, allocated in
3 places in classid.c, at lines 280, 284 and 289.

It seems related to the module's constructor classid_init
which allocates resources, with no destructor to free it.

The attached patch tries to fix this issue by registering
a destructor which performs the tree liberation at exit.
2012-04-19 18:51:17 +02:00
Thomas Graf 7d47666eb3 doc: Fix incorrect nl_socket_add_memberships() example
Reported by: Andrew Collins <bsderandrew@gmail.com>
Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-03-26 14:02:25 +02:00
Romary Sonrier 965fd78042 missing extended Table attribute for lib/route/
I found a small bug in libnl, about extended table id ( above 256 ).

Signed-off-by: Romary Sonrier <romary@sonrier.com>
Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-03-06 10:15:30 +01:00
Thomas Graf f7d06614fc doc: Fix typos in autoconf example
Reported by nick black <dankamongmen@gmail.com>
2012-02-23 00:20:45 +01:00
Thierry Reding 0b40364150 Add new nl_cache_clone() function.
The function can be used to make a copy of an existing cache. It is very
similar to nl_cache_subset() except that it allows no filtering but
copies every object.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-02-16 13:42:49 +01:00
Shriram Rajagopalan a17970b974 Support plug qdisc - queue traffic until explicit release
The plug qdisc supports two operations - plug and unplug. When the
qdisc receives a plug ("buffer") command via netlink request,
packets arriving henceforth are buffered until a corresponding unplug
command is received. Depending on the type of unplug ("release_one"
or "release_indefinite"), the queue can be unplugged indefinitely or
selectively.

The plug qdisc allows a user to implement network output buffering
(aka output commit), used commonly in checkpoint based fault tolerance
systems. It also supports a general purpose queue plug/unplug
functionality.

The associated kernel module is available in David Miller's net-next
tree, commit: c3059be16c9ef29c05f0876a9df5fea21f29724f

This patch introduces userspace tools and API, to control the qdisc
via netlink messages.

Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca>
Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-02-14 12:02:04 +01:00
Brett Ciphery a39bb563ab add new function to provide neighbour event parsing
the neighbour parsing function was previously not accessible, so
custom callback functions had to handle the decoding itself.
rtnl_neigh_parse is introduced and implemented in much the same way
as rtnl_route_parse.

Signed-off-by: Brett Ciphery <brett.ciphery@windriver.com>
Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-01-30 12:54:29 +01:00
Thomas Graf 9cbcbca77d 3.2.7 release
fixes a bug in SO versioning. libtool age was increased incorrectly
which resulted in an incorrect SO version string in the releases
3.2.5 and 3.2.6.
2012-01-25 17:06:15 +01:00
Thomas Graf 4cc1daab3f 3.2.6 release 2012-01-17 12:51:15 +01:00
Thomas Graf 83ab0ae85f man: Remove bogus .LO macro in manpages
Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-01-17 12:45:06 +01:00
Thomas Graf c857625be0 Update COPYING to fix FSF address
Apparently we have been shiping an outdated version of the LGPL
containing an obsolete address of the FSF.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-01-17 12:38:37 +01:00
Thomas Graf d111b1df47 cli: Use -avoid-version to link cli modules
Signed-off-by: Thomas Graf <tgraf@redhat.com>
2012-01-17 12:34:26 +01:00
Thomas Graf 9015d115f8 3.2.5 release 2012-01-12 13:17:32 +01:00
Torsten Hilbrich 4035e5b5e8 link: fix regression in link message parser
In a simple test program that queries the source IP for a given
destination address I get a crash in the call to rtnl_link_alloc_cache.

Here is the stack trace (created with version 3.2.4):

Program received signal SIGSEGV, Segmentation fault.
0xb7eb7553 in strlen () from /lib/libc.so.6
(gdb) bt
#0  0xb7eb7553 in strlen () from /lib/libc.so.6
#1  0xb7eb7285 in strdup () from /lib/libc.so.6
#2  0xb7fcc305 in nla_strdup (nla=0x0) at attr.c:1033
#3  0xb7f9c173 in link_msg_parser (ops=0xb7fc2940, who=0x804b330, n=0x804c3e8, pp=0xbffffbf8) at route/link.c:486
#4  0xb7fcd485 in nl_cache_parse (ops=0xb7fc2940, who=0x804b330, nlh=0x804c3e8, params=0xbffffbf8) at cache.c:724
#5  0xb7fcd547 in update_msg_parser (msg=0x804b328, arg=0xbffffbb8) at cache.c:531
#6  0xb7fd1f25 in nl_cb_call (cb=<optimized out>, msg=<optimized out>, type=<optimized out>) at ../include/netlink-local.h:126
#7  recvmsgs (cb=<optimized out>, sk=<optimized out>) at nl.c:729
#8  nl_recvmsgs (sk=0x804b2d0, cb=0x804b368) at nl.c:780
#9  0xb7fcd5fd in __cache_pickup (sk=0x804b2d0, cache=<optimized out>, param=0xbffffbf8) at cache.c:560
#10 0xb7fcd83f in nl_cache_pickup (sk=0x804b2d0, cache=0x804b308) at cache.c:593
#11 0xb7fcd8c8 in nl_cache_refill (sk=0x804b2d0, cache=0x804b308) at cache.c:780
#12 0xb7f9d1fc in rtnl_link_alloc_cache (sk=0x804b2d0, family=4, result=0xbffffcd4) at route/link.c:868
#13 0x08048fd0 in libnl_init (data=<optimized out>) at helper_route.c:60
#14 iproute_get_source (destination=0xbffffeff "127.0.0.1",
    source=0xbffffd0f "\b\004c\370\267\364_\370\267\260\224\004\b8\375\377\277e\024\347\267\320\016\377\267\273\224\004\b\364_\370\267\260\224\004\b", source_size=17)
    at helper_route.c:105
#15 0x08048e6a in main (argc=2, argv=0xbffffde4) at ip_route_get.c:25

The attached patch (against 3.2.4) solves the problem, fixing something that
looks like a typo. The bug is still present in current Git master.
2012-01-12 13:15:31 +01:00
Brett Ciphery 794ac78c56 nl_addr_cmp(): handle prefix length during address comparison
Signed-off-by: Brett Ciphery <brett.ciphery@windriver.com>
2012-01-12 10:18:35 +01:00
Thomas Graf d7222e5dde 3.2.4 release 2012-01-11 12:51:03 +01:00
Alexander Sack 9819717444 avoid dangling co_major_cache reference to NL_AUTO_PROVIDE caches 2012-01-11 12:31:40 +01:00
Thomas Graf 4a7791eca1 dsmark: Add missing declarations for rtnl_class_dsmark_(get|set)_bitmask()
The existing declarations refered to non-existing functions so removing
them is safe.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-11-25 16:09:34 +01:00
Jiri Pirko 847e269c56 rtnl_link_bond_add: allow to allocate bond name in case NULL is given
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
2011-11-11 16:24:53 +01:00
Jiri Pirko ef75c4edf0 link: allow to add/get linkinfo of unknown type
store type kind in rtnl_link independently. That would allow to use this
value even if type_ops are not present. This allows for example to
create devices of type unknown to libnl.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
2011-11-11 15:37:03 +01:00
Jan Engelhardt 88940b71f8 build: simplify optional dirs/files in Makefile.am processing 2011-11-11 11:55:29 +01:00