dect
/
libnl
Archived
13
0
Fork 0
Commit Graph

16 Commits

Author SHA1 Message Date
Коренберг Марк 00261259f0 Address comparison bug fixed
Bug introduced in 794ac78c56
2012-08-30 21:00:39 +06:00
Justin Mayfield de28daf226 nl_addr_parse handling of 'default', 'any', and 'all'
I found a small bug in the nl_addr_parse function when being passed the
strings "default", "any", or "all".  Currently nl_addr_parse will create
a zeroed nl_addr with a length corresponding to the family/hint or
AF_INET if omitted.  This behavior when used in conjunction with the
libnl-route library to add default routes to the system has the side
effect of creating a route to the host address 0.0.0.0/32.

Attached is a patch that matches the iproute2 behavior more closely
where we do set the family but the length of the nl_addr is set to 0.
2012-08-29 12:17:24 +02:00
Коренберг Марк 2bdcde7e8e Fix types-related warnings based on clang diagnostics
1. Fix some places where unsigned value compared < 0
2. Fix obsolete %Z specifier to more portable %z
3. Some erroneous types substitution
4. nl_msec2str() - 64-bit msec is now properly used,

Only safe changes. I mean int <--> uint32_t and signed/unsigned fixes.
Some functinos require size_t argument instead of int, but changes of
signatures of that functions is terrible thing.

Also, I do not pretend for a full list of fixes.
Just to shut up clang -Wall -Wextra

One more thing. ifindex. I don't change that because changes will
be too big for simple fix.
2012-06-13 13:30:26 +02:00
Thomas Graf fec10a2823 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
2012-05-10 12:03:59 +02: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 7105aea116 addr: hide nl_addr_destroy()
everyone should use nl_addr_put()
2010-11-26 16:32:10 +01:00
Thomas Graf cf5577d280 constify struct trans_tbl 2010-11-17 16:09:08 +01:00
Thomas Graf 2847cf081b Make nl_str2af return a negative value if parsing fails 2010-11-11 22:25:32 +01:00
Thomas Graf 6782b6f709 restructure module documentation order
split hiearchy into one top level module per library
2008-12-10 18:12:30 +01:00
Thomas Graf 5ab9421111 Properly handle addr=NULL in nl_addr2str 2008-06-13 16:39:35 +02:00
Thomas Graf 304746f8d0 Fix error code of nl_addr_resolve() 2008-05-22 23:49:11 +02:00
Thomas Graf eed2afaab7 Remove obsolete nla_get_addr() and nla_get_data()
Replaces obsolete calls to nla_get_addr() and nla_get_data()
with nl_addr_alloc_attr() respectively nl_data_alloc_attr().

Also fixes missing error handling while parsing routing multipath
configuration.
2008-05-14 18:26:47 +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 0fa6756cca Abstract address allocation based on netlink attribute 2008-01-30 13:14:58 +01:00
Thomas Graf 3ad4665be2 Support link operstate and linkmode 2007-12-19 22:03:44 +01:00
Thomas Graf 44d362409d Initial import 2007-09-15 01:28:01 +02:00