]> granicus.if.org Git - libnl/log
libnl
12 years agogenl: Support registration of families without depending on caches
Thomas Graf [Fri, 1 Jun 2012 09:48:08 +0000 (11:48 +0200)]
genl: Support registration of families without depending on caches

Introduces the functions genl_register_family() and
genl_unregister_family() to register a Generic Netlink family
which does not implement a cachable type.

API users can direct received messages into genl_handle_msg() which
will validate the messages and call the callback functions defined
in the commands definition.

See test/test-genl.c for an example on how to use it.

12 years agogenl: Add genlmsg_user_hdr(), genlmsg_user_data(), and genlmsg_user_datalen()
Thomas Graf [Thu, 31 May 2012 11:37:57 +0000 (13:37 +0200)]
genl: Add genlmsg_user_hdr(), genlmsg_user_data(), and genlmsg_user_datalen()

These functions deprecate the function genlmsg_data() which did not
allow to specify the length of the user header. Use of the new API
will make code much clearer. The old function is still kept around
for backwards compatibility but marked deprecated in the API reference.

12 years agogenl: Add genlmsg_hdr()
Thomas Graf [Thu, 31 May 2012 11:13:50 +0000 (13:13 +0200)]
genl: Add genlmsg_hdr()

Explicit function to calculate the genl hdr based on nlh

12 years agogenl: updates to API reference documentation
Thomas Graf [Thu, 31 May 2012 11:11:48 +0000 (13:11 +0200)]
genl: updates to API reference documentation

12 years agouse MSG_TRUNC flag to get recv message size at once
Jiri Pirko [Mon, 28 May 2012 12:05:27 +0000 (14:05 +0200)]
use MSG_TRUNC flag to get recv message size at once

prevent multiple calls of recvmsg.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
12 years agocorrect HTB rtable/HZ calculations
Andrew Collins [Sat, 26 May 2012 00:08:06 +0000 (18:08 -0600)]
correct HTB rtable/HZ calculations

The HTB implementation in libnl uses units of microseconds in a number
of places where it seems TC is expecting time in units of ticks, which
causes actual rates much higher than requested.  Additionally, libnl
uses USER_HZ for calculating buffer and cbuffer sizes, which can
result in much larger buffers than necessary on systems with high
resolution timers.

Note that the TBF qdisc uses microseconds incorrectly in two spots as
well, I fixed this but did not test.

12 years agoadd fwmark mask support
A C [Fri, 25 May 2012 19:45:45 +0000 (13:45 -0600)]
add fwmark mask support

The fw classifier allows a mask to be set, which is necessary for some
complex shaping/firewall scenarios.  The attached patch adds support
for it to libnl.

12 years agoFix for dumping objects to a buffer instead of file descriptor
Bushman, Jeff [Wed, 16 May 2012 15:50:25 +0000 (11:50 -0400)]
Fix for dumping objects to a buffer instead of file descriptor

Attached is a patch to fix two problems with dumping objects to a buffer in=
stead of a file descriptor.
One was a problem in detecting the end of the buffer in the newline code.
The other was a problem with clearing the whole buffer before printing each=
 object.

12 years agou32: fix various u32 hashing related warnings
Adrian Ban [Wed, 16 May 2012 11:43:52 +0000 (13:43 +0200)]
u32: fix various u32 hashing related warnings

I've add an missing u32 hash filter missing from u32.h
I've fix all warnings in file test-complex-HTB-with-hash-filters.c

12 years agotc: fix included headers
Thomas Graf [Wed, 16 May 2012 11:42:05 +0000 (13:42 +0200)]
tc: fix included headers

Reported-by: Adrian Ban <adrian.ban@mantech.ro>
12 years agoFTBFS with musl libc: Missing includes
Isaac [Sun, 13 May 2012 05:37:48 +0000 (22:37 -0700)]
FTBFS with musl libc: Missing includes

Hello,
libnl 3.2.9 does not build with musl libc, without patching.
I' using a current musl libc (http://www.etalabs.net/musl/)
with linux 2.6.32 headers.
At first there were a couple problems on the musl side, but those are
resolved.
However, I found some other issues:
First, two files were missing
#include <byteswap.h>:
lib/netfilter/log_msg.c
lib/netfilter/queue_msg.c
These files used __bswap_64 (which should be bswap_64), a macro
declared in byteswap.h

Second, I got this error after fixing that:

In file included from nf-queue.c:16:
./include/linux/netfilter.h:53: error: field in has incomplete type
./include/linux/netfilter.h:54: error: field in6 has incomplete type

I found that src/nf-queue.c is missing an
#include <netinet/in.h>

Attached is a patch which resolves these issues.  I've tested with both
musl and glibc, and it builds cleanly on both.

12 years agodoc: documentation restructuring
Thomas Graf [Thu, 10 May 2012 10:03:59 +0000 (12:03 +0200)]
doc: documentation restructuring

- changes the modules hierarchy to better represent the set of libaries
- list the header file that needs to be included
- remove examples/doc from api ref that is included in the guide
- add references to the guide
- fix doxygen api linking for version 1.8.0
- readd doxygen mainpage to config file
- fix a couple of doxygen doc bugs

12 years ago__str2flags fix
Justin Mayfield [Thu, 10 May 2012 03:08:30 +0000 (21:08 -0600)]
__str2flags fix

I found a minor bug in __str2flags where empty strings or short strings
will match all or many flags respectively.  Basically the test needs to
ensure the test string is the same length as the table entry before
doing a strncasecmp to avoid doing just a prefix test.

12 years agoroute: Add FIXME to rtnl_route_nh_set_gateway() to fix return value
Thomas Graf [Wed, 9 May 2012 13:03:46 +0000 (15:03 +0200)]
route: Add FIXME to rtnl_route_nh_set_gateway() to fix return value

Reported-by: Justin Mayfield <jmayfield@cradlepoint.com>
12 years agodoc: add section about addressing
Thomas Graf [Wed, 9 May 2012 13:02:40 +0000 (15:02 +0200)]
doc: add section about addressing

Adds a new section to netlink fundamentals explaining the common
addressing use cases and illustrates kernel->user, user->user,
and user->kernel communication.

12 years agodoc: Check documentation generation requirements with autoconf
Thomas Graf [Wed, 9 May 2012 08:06:24 +0000 (10:06 +0200)]
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.

12 years agou32: example/test code for u32 hashing with HTB
Adrian Ban [Tue, 8 May 2012 21:17:53 +0000 (23:17 +0200)]
u32: example/test code for u32 hashing with HTB

12 years agou32: add support for hashing
Adrian Ban [Tue, 8 May 2012 21:14:13 +0000 (23:14 +0200)]
u32: add support for hashing

12 years ago3.2.9 release libnl3_2_9
Thomas Graf [Tue, 8 May 2012 20:53:26 +0000 (22:53 +0200)]
3.2.9 release

12 years agonl: Fix return value of nl_recvmsgs()
Thomas Graf [Tue, 8 May 2012 20:48:00 +0000 (22:48 +0200)]
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>
12 years agoFix two bugs in 3.2.8/doc/
Jeroen Roovers [Tue, 1 May 2012 18:32:57 +0000 (20:32 +0200)]
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

12 years ago3.2.8 release libnl3_2_8
Thomas Graf [Thu, 26 Apr 2012 09:22:49 +0000 (11:22 +0200)]
3.2.8 release

12 years agoobject: Add functions to access the object type, cache and object ops
Thomas Graf [Tue, 24 Apr 2012 12:55:23 +0000 (14:55 +0200)]
object: Add functions to access the object type, cache and object ops

12 years agocache: Add co_include_event allowing caches to provide their own nl_cache_include...
Thomas Graf [Sun, 22 Apr 2012 13:23:52 +0000 (15:23 +0200)]
cache: Add co_include_event allowing caches to provide their own nl_cache_include() implementation

12 years agocache: improve documentation of co_event_filter
Thomas Graf [Sun, 22 Apr 2012 12:36:01 +0000 (14:36 +0200)]
cache: improve documentation of co_event_filter

12 years agogenl: Make genl_unregister() a NOP if NULL pointer is passed
Thomas Graf [Sun, 22 Apr 2012 09:12:01 +0000 (11:12 +0200)]
genl: Make genl_unregister() a NOP if NULL pointer is passed

12 years agocache_mngr: Make providing the result pointer to nl_cache_mngr_add() optional
Thomas Graf [Sat, 21 Apr 2012 13:51:43 +0000 (15:51 +0200)]
cache_mngr: Make providing the result pointer to nl_cache_mngr_add() optional

12 years agotest-cache-mngr: Allow for management of arbitary caches via argument string
Thomas Graf [Sat, 21 Apr 2012 13:49:09 +0000 (15:49 +0200)]
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.

12 years agocache_mngr: Provide nl_cache_mngr_info() to pring cache manager details
Thomas Graf [Sat, 21 Apr 2012 13:48:37 +0000 (15:48 +0200)]
cache_mngr: Provide nl_cache_mngr_info() to pring cache manager details

Useful for debugging and testing

12 years agocache_mngr: API doc updates
Thomas Graf [Sat, 21 Apr 2012 13:22:04 +0000 (15:22 +0200)]
cache_mngr: API doc updates

12 years agocache_mngr: Let nl_cache_mngr_data_ready() read multiple messages
Thomas Graf [Sat, 21 Apr 2012 10:47:29 +0000 (12:47 +0200)]
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.

12 years agonl: Make nl_recvmsgs() return the number of netlink messages processed
Thomas Graf [Sat, 21 Apr 2012 10:46:01 +0000 (12:46 +0200)]
nl: Make nl_recvmsgs() return the number of netlink messages processed

12 years agocache_mngr: Fix memory corruption after resizing
Thomas Graf [Sat, 21 Apr 2012 10:23:38 +0000 (12:23 +0200)]
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.

12 years agotest-cache-mngr: Let the cache manager allocate the socket
Thomas Graf [Sat, 21 Apr 2012 10:14:11 +0000 (12:14 +0200)]
test-cache-mngr: Let the cache manager allocate the socket

12 years agocache_mngr: Automatically allocate socket if needed
Thomas Graf [Sat, 21 Apr 2012 10:11:45 +0000 (12:11 +0200)]
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)

12 years agocache_manager: Move documentation to doc/core.txt
Thomas Graf [Sat, 21 Apr 2012 09:38:33 +0000 (11:38 +0200)]
cache_manager: Move documentation to doc/core.txt

12 years agocache_mngr: Don't modify callback setup of socket
Thomas Graf [Sat, 21 Apr 2012 08:51:34 +0000 (10:51 +0200)]
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.

12 years agotests: fix test programs to compile again
Thomas Graf [Sat, 21 Apr 2012 08:35:20 +0000 (10:35 +0200)]
tests: fix test programs to compile again

12 years agotests: Convert tests/Makefile to use automake
Thomas Graf [Sat, 21 Apr 2012 08:34:43 +0000 (10:34 +0200)]
tests: Convert tests/Makefile to use automake

12 years agocache_mngr: document uncommon error codes
Thomas Graf [Sat, 21 Apr 2012 07:59:26 +0000 (09:59 +0200)]
cache_mngr: document uncommon error codes

12 years agogenl-ctrl-list: Mark for installation
Thomas Graf [Fri, 20 Apr 2012 13:28:48 +0000 (15:28 +0200)]
genl-ctrl-list: Mark for installation

12 years agogenl-ctrl-list: fix copyright and summary
Thomas Graf [Fri, 20 Apr 2012 13:27:52 +0000 (15:27 +0200)]
genl-ctrl-list: fix copyright and summary

12 years agogenl-ctrl-list: Provide manual page
Thomas Graf [Fri, 20 Apr 2012 13:19:41 +0000 (15:19 +0200)]
genl-ctrl-list: Provide manual page

12 years agogenl-ctrl-list: Introduce -d|--details as a shortcut for --format=details
Thomas Graf [Fri, 20 Apr 2012 13:18:21 +0000 (15:18 +0200)]
genl-ctrl-list: Introduce -d|--details as a shortcut for --format=details

12 years agoMemory leak in classid.c
Nicolas CARRIER [Fri, 13 Apr 2012 11:51:44 +0000 (13:51 +0200)]
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.

12 years agodoc: Fix incorrect nl_socket_add_memberships() example
Thomas Graf [Mon, 26 Mar 2012 12:02:25 +0000 (14:02 +0200)]
doc: Fix incorrect nl_socket_add_memberships() example

Reported by: Andrew Collins <bsderandrew@gmail.com>
Signed-off-by: Thomas Graf <tgraf@redhat.com>
12 years agomissing extended Table attribute for lib/route/
Romary Sonrier [Sat, 3 Mar 2012 00:46:46 +0000 (01:46 +0100)]
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>
12 years agodoc: Fix typos in autoconf example
Thomas Graf [Wed, 22 Feb 2012 23:20:45 +0000 (00:20 +0100)]
doc: Fix typos in autoconf example

Reported by nick black <dankamongmen@gmail.com>

12 years agoAdd new nl_cache_clone() function.
Thierry Reding [Thu, 16 Feb 2012 11:57:42 +0000 (12:57 +0100)]
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>
12 years agoSupport plug qdisc - queue traffic until explicit release
Shriram Rajagopalan [Sun, 12 Feb 2012 22:53:10 +0000 (14:53 -0800)]
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>
12 years agoadd new function to provide neighbour event parsing
Brett Ciphery [Sun, 29 Jan 2012 17:19:00 +0000 (12:19 -0500)]
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>
12 years ago3.2.7 release libnl3_2_7
Thomas Graf [Wed, 25 Jan 2012 16:03:37 +0000 (17:03 +0100)]
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.

12 years ago3.2.6 release libnl3_2_6
Thomas Graf [Tue, 17 Jan 2012 11:51:15 +0000 (12:51 +0100)]
3.2.6 release

12 years agoman: Remove bogus .LO macro in manpages
Thomas Graf [Tue, 17 Jan 2012 11:45:06 +0000 (12:45 +0100)]
man: Remove bogus .LO macro in manpages

Signed-off-by: Thomas Graf <tgraf@redhat.com>
12 years agoUpdate COPYING to fix FSF address
Thomas Graf [Tue, 17 Jan 2012 11:38:37 +0000 (12:38 +0100)]
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>
12 years agocli: Use -avoid-version to link cli modules
Thomas Graf [Tue, 17 Jan 2012 11:34:26 +0000 (12:34 +0100)]
cli: Use -avoid-version to link cli modules

Signed-off-by: Thomas Graf <tgraf@redhat.com>
12 years ago3.2.5 release libnl3_2_5
Thomas Graf [Thu, 12 Jan 2012 12:17:32 +0000 (13:17 +0100)]
3.2.5 release

12 years agolink: fix regression in link message parser
Torsten Hilbrich [Thu, 12 Jan 2012 11:28:18 +0000 (12:28 +0100)]
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.

12 years agonl_addr_cmp(): handle prefix length during address comparison
Brett Ciphery [Wed, 11 Jan 2012 16:40:11 +0000 (11:40 -0500)]
nl_addr_cmp(): handle prefix length during address comparison

Signed-off-by: Brett Ciphery <brett.ciphery@windriver.com>
13 years ago3.2.4 release libnl3_2_4
Thomas Graf [Wed, 11 Jan 2012 11:51:03 +0000 (12:51 +0100)]
3.2.4 release

13 years agoavoid dangling co_major_cache reference to NL_AUTO_PROVIDE caches
Alexander Sack [Thu, 20 Oct 2011 22:31:39 +0000 (00:31 +0200)]
avoid dangling co_major_cache reference to NL_AUTO_PROVIDE caches

13 years agodsmark: Add missing declarations for rtnl_class_dsmark_(get|set)_bitmask()
Thomas Graf [Fri, 25 Nov 2011 15:08:25 +0000 (16:08 +0100)]
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>
13 years agortnl_link_bond_add: allow to allocate bond name in case NULL is given
Jiri Pirko [Fri, 11 Nov 2011 15:01:52 +0000 (16:01 +0100)]
rtnl_link_bond_add: allow to allocate bond name in case NULL is given

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
13 years agolink: allow to add/get linkinfo of unknown type
Jiri Pirko [Fri, 11 Nov 2011 13:56:16 +0000 (14:56 +0100)]
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>
13 years agobuild: simplify optional dirs/files in Makefile.am processing
Jan Engelhardt [Fri, 11 Nov 2011 00:33:51 +0000 (01:33 +0100)]
build: simplify optional dirs/files in Makefile.am processing

13 years agorelease 3.2.3 libnl3_2_3
Thomas Graf [Thu, 10 Nov 2011 14:04:43 +0000 (15:04 +0100)]
release 3.2.3

13 years agoadd missing IFLA_MASTER fillup
Jiri Pirko [Mon, 7 Nov 2011 13:35:13 +0000 (14:35 +0100)]
add missing IFLA_MASTER fillup

this makes all set_master functions work.

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
13 years agolink: generic link enslaving API
Thomas Graf [Mon, 7 Nov 2011 11:32:35 +0000 (12:32 +0100)]
link: generic link enslaving API

Adds rtnl_link_enslave() / rtnl_link_release() providing a genreic
link enslaving/release API for use with all link types which use
the IFLA_MASTER property.

13 years agobump to 3.2.2 libnl3_2_2
Thomas Graf [Sun, 30 Oct 2011 16:07:13 +0000 (17:07 +0100)]
bump to 3.2.2

13 years agoFix typo in debug message
Thomas Graf [Fri, 28 Oct 2011 10:30:31 +0000 (12:30 +0200)]
Fix typo in debug message

13 years agopython: Link against nl-3 and nl-route-3
Thomas Graf [Wed, 26 Oct 2011 08:54:10 +0000 (10:54 +0200)]
python: Link against nl-3 and nl-route-3

13 years agolink: Ignore bridging notifications in link cache manager
Thomas Graf [Fri, 21 Oct 2011 09:31:58 +0000 (11:31 +0200)]
link: Ignore bridging notifications in link cache manager

RTM_DELLINK and RTM_NEWLINK bridging notifications should not delete/add
entries to a link cache.

13 years agocache: event_filter() cache operation to filter notifications
Thomas Graf [Fri, 21 Oct 2011 09:31:15 +0000 (11:31 +0200)]
cache: event_filter() cache operation to filter notifications

Certain notifications need to be filtered out and should not be applied to
a cache when a cache is handled by a cache manager.

13 years agoutils: Initialize list head after freeing translation list
Thomas Graf [Mon, 10 Oct 2011 10:02:33 +0000 (12:02 +0200)]
utils: Initialize list head after freeing translation list

Problem found and fix proposed by Andrew Kraslavsky <andykras@hotmail.com>

13 years agoOnly use the MULTIPATH attribute when adding routes with more than one next hop.
Michael Altizer [Sun, 9 Oct 2011 21:02:36 +0000 (17:02 -0400)]
Only use the MULTIPATH attribute when adding routes with more than one next hop.

Only use the MULTIPATH attribute when adding routes with more than one
next hop.
This solves issues with two scenarios:
1. Adding an IPv4 route to a kernel configured without
CONFIG_IP_ROUTE_MULTIPATH=y.
2. Adding an IPv6 route in general, since the MULTIPATH attribute is not
supported there.

Signed-off-by: Michael Altizer <xiche@verizon.net>
13 years agoDon't install CLI header files when --disable-cli has been configured.
Michael Altizer [Sun, 9 Oct 2011 21:02:35 +0000 (17:02 -0400)]
Don't install CLI header files when --disable-cli has been configured.

Signed-off-by: Michael Altizer <xiche@verizon.net>
13 years agoFix rtnl_link object memory leak when freeing rtnl_addr objects.
Michael Altizer [Sun, 9 Oct 2011 21:02:34 +0000 (17:02 -0400)]
Fix rtnl_link object memory leak when freeing rtnl_addr objects.

Signed-off-by: Michael Altizer <xiche@verizon.net>
13 years agoAdd libnl-cli-3.0 to pkg-config tool
Jiří Župka [Tue, 4 Oct 2011 14:06:22 +0000 (16:06 +0200)]
Add libnl-cli-3.0 to pkg-config tool

Signed-off-by: Jiří Župka <jzupka@redhat.com>
13 years ago3.2.1 release libnl3_2_1
Thomas Graf [Mon, 19 Sep 2011 09:47:49 +0000 (11:47 +0200)]
3.2.1 release

Added more details on the changes to where and how libnl is being
instaslled since 3.2.0

13 years agoProvide micro version in <netlink/version.h>
Thomas Graf [Mon, 19 Sep 2011 09:28:20 +0000 (11:28 +0200)]
Provide micro version in <netlink/version.h>

13 years agoIngnore src/nl-link-enslave and nl-link-release
Thomas Graf [Mon, 19 Sep 2011 09:24:52 +0000 (11:24 +0200)]
Ingnore src/nl-link-enslave and nl-link-release

13 years agoBonding: Fix header guard of <netlink/route/link/bonding.h>
Thomas Graf [Fri, 16 Sep 2011 11:17:04 +0000 (13:17 +0200)]
Bonding: Fix header guard of <netlink/route/link/bonding.h>

(Would be a good idea to change the header guard name when c&p
 an existing header file to create a new one.)

13 years agobonding: Install <netlink/route/link/bonding.h>
Thomas Graf [Fri, 16 Sep 2011 11:07:03 +0000 (13:07 +0200)]
bonding: Install <netlink/route/link/bonding.h>

13 years agobonding: API to create/enslave/release
Thomas Graf [Fri, 16 Sep 2011 10:57:52 +0000 (12:57 +0200)]
bonding: API to create/enslave/release

Although it has been possible to create bonding devices, enslave and
release using the regular link API. The added API simplifies usage
and hides some of the compatibility logic.

F.e. enslave() and release() will both verify that the master assignment
has in fact been changed and return -NLE_OPNOTSUPP if it did not.

Also the API will make sure to use RTM_NEWLINK or RTM_SETLINK depending
on what is availble.

Examples are provided in src/ as nl-link-enslave.c and nl-link-release.c

13 years agolink: Eat ACK followed by RTM_NEWLINK when requesting single link
Thomas Graf [Wed, 14 Sep 2011 09:43:10 +0000 (11:43 +0200)]
link: Eat ACK followed by RTM_NEWLINK when requesting single link

When requesting a single link with RTM_GETLINK (no dump) the
RTM_NEWLINK carrying the answer will be followed by an ACK
we have to wait for.

13 years agoFix a73cb2f26 fallout to allow building in separate directory libnl3_2
Thomas Graf [Tue, 13 Sep 2011 21:33:06 +0000 (23:33 +0200)]
Fix a73cb2f26 fallout to allow building in separate directory

Commit a73cb2f26932d90a2d47a28e9c524e7f33dcffbd missed to change the
EXTRA_DATA section

13 years agotools: Use LDADD and link against .la files instead of LDFLAGS and -llib
Thomas Graf [Tue, 13 Sep 2011 21:21:52 +0000 (23:21 +0200)]
tools: Use LDADD and link against .la files instead of LDFLAGS and -llib

13 years agoroute: Remove dead link_cache variable
Thomas Graf [Tue, 13 Sep 2011 21:16:09 +0000 (23:16 +0200)]
route: Remove dead link_cache variable

13 years agoaddr: Add missing header to <netlink/route/addr.h>
Thomas Graf [Tue, 13 Sep 2011 21:13:51 +0000 (23:13 +0200)]
addr: Add missing header to <netlink/route/addr.h>

Fixes a gcc warning

13 years agoSwitch to libtool versioning system
Thomas Graf [Tue, 13 Sep 2011 20:58:08 +0000 (22:58 +0200)]
Switch to libtool versioning system

It has been a request that multiple libnl versions should be installabe
in parallel.

In order to achieve this, the basename of the library was changed to
libnl-3 which reflects the 3rd generation of libnl APIs. It also means
that release based library versioning is left behind and libtool
versioning is used instead.

Projects using pkgconfig will automatically link against the new library
basename and will not notice a difference.

The SO versioning is based on the glib model:
  current := 100 * minor + micro - revision
  revision := revision
  age := age (number of backwards compatible versions)

13 years agobuild: always install files into /etc/libnl
Jan Engelhardt [Wed, 24 Aug 2011 10:09:46 +0000 (12:09 +0200)]
build: always install files into /etc/libnl

I observed that with the RedHat build target in the Open Build
Service, files were put into /etc rather than /etc/libnl.
Self-referential variables are a bad idea, and so just avoid this.

13 years agoInform users about changed include location at end of configure script
Thomas Graf [Tue, 13 Sep 2011 09:49:41 +0000 (11:49 +0200)]
Inform users about changed include location at end of configure script

13 years agoInstall headers in ${includedir}/libnl3
Thomas Graf [Tue, 13 Sep 2011 09:48:18 +0000 (11:48 +0200)]
Install headers in ${includedir}/libnl3

This allows for multiple major versions to be installed in parallel. Pkg-config
files are adapted to provide appropriate cflags to find new header locations.

13 years agolib: Use @MAJ_VERSION and @MAJ_MINOR@ for -version-info
Thomas Graf [Tue, 13 Sep 2011 09:47:39 +0000 (11:47 +0200)]
lib: Use @MAJ_VERSION and @MAJ_MINOR@ for -version-info

13 years agoasciidoc xhtml stylesheet
Thomas Graf [Tue, 13 Sep 2011 09:07:23 +0000 (11:07 +0200)]
asciidoc xhtml stylesheet

13 years agoprepare for 3.2 release
Thomas Graf [Thu, 8 Sep 2011 13:00:07 +0000 (15:00 +0200)]
prepare for 3.2 release

Fall back to using libnl-*.3.pc files. It may be common to have multiple
generations of libnl installed but unlikely within the same major release.

13 years agoremove dist lines for non existing files
Thomas Graf [Thu, 8 Sep 2011 13:33:55 +0000 (15:33 +0200)]
remove dist lines for non existing files

13 years agoRemove GPL-3.0 license file.
Thomas Graf [Thu, 8 Sep 2011 13:07:02 +0000 (15:07 +0200)]
Remove GPL-3.0 license file.

There is no code licensed GPL-3.0 so we might as well remove this file.

13 years agofix license of lib/route/pktloc.c
Thomas Graf [Thu, 8 Sep 2011 13:03:25 +0000 (15:03 +0200)]
fix license of lib/route/pktloc.c

As Jan Engelhardt pointed out, pktloc.c is currently licenses under the GPL
rather than the LGPL. This is a result of its previous existance in src/
which is GPL licensed. I missed to change its license when moving it to
lib/. Since I am the only contributor to the code, I am changing the license
hereby.

13 years agoDo not require python and swig to be present
Thomas Graf [Thu, 8 Sep 2011 12:59:16 +0000 (14:59 +0200)]
Do not require python and swig to be present

Allows building without python and swig. Readd this using --enable-python
at some point.