dect
/
libnl
Archived
13
0
Fork 0
Commit Graph

6 Commits

Author SHA1 Message Date
Patrick McHardy 3c28aa5dca Fix rule attribute comparison
Rules don't have unique identifiers, so all attributes are compared
by initializing the ID mask to ~0. This doesn't work however since
nl_object_identical verifies whether the ID attributes are actually
present before comparing the objects, which is never the case.

Work around by using the intersection of present attributes when
comparing two rule objects.

Signed-off-by: Patrick McHardy <kaber@trash.net>
2010-04-19 12:43:18 +02:00
Alexander Sack 7d249fc2e1 nl_object_clone: properly clone ce_mask field
based on my finding, ce_mask needs to be identical on clones; otherwise
some functions (like "dump") will treat clones differently.
2009-07-20 11:58:57 +02:00
Pavel Roskin a8cd7b62c8 nl_object_priv() is inline, so define it in the header 2009-04-16 12:29:13 +02:00
Thomas Graf 8a3efffa5b Thread-safe error handling
In order for the interface to become more thread safe, the error
handling was revised to no longer depend on a static errno and
error string buffer.

This patch converts all error paths to return a libnl specific
error code which can be translated to a error message using
nl_geterror(int error). The functions nl_error() and
nl_get_errno() are therefore obsolete.

This change required various sets of function prototypes to be
changed in order to return an error code, the most prominent
are:

    struct nl_cache *foo_alloc_cache(...);
changed to:
    int foo_alloc_cache(..., struct nl_cache **);

    struct nl_msg *foo_build_request(...);
changed to:
    int foo_build_request(..., struct nl_msg **);

    struct foo *foo_parse(...);
changed to:
    int foo_parse(..., struct foo **);

This pretty much only leaves trivial allocation functions to
still return a pointer object which can still return NULL to
signal out of memory.

This change is a serious API and ABI breaker, sorry!
2008-05-14 17:49:44 +02:00
Thomas Graf 535e831622 Big routing code rework (API/ABI BREAK!)
Adds all missing routing attributes and brings the routing
related code to a working state. In the process the API
was broken several times with the justification that nobody
is using this code yet.

The changes include new example code which is also a prototype
for how plain CLI tools could look like to control routes.
2008-04-29 23:31:30 +02:00
Thomas Graf 44d362409d Initial import 2007-09-15 01:28:01 +02:00