| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
| |
allow the parsing of {netlink,packet,unix}_diag, even if they are
using type 0 for valid attributes.
It lacked this part in nla_parse.
Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Samuel Gauthier <samuel.gauthier@6wind.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
|
|
|
|
|
|
|
|
|
|
|
|
| |
{netlink,packet,unix}_diag use attribute type 0 for valid
attributes. The value was reserved and usage was prohibited
by the protocol but we can't undo the breakge.
Make libnl accept attribute type 0 to allow parsing these
attributes.
Reported-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Signed-off-by: Thomas Graf <tgraf@suug.ch>
|
|
|
|
|
|
|
| |
There seams to be an error in the calculation of needed space for the message in nla_reserve. The current size of the message is counted twice: Once in NLMSG_ALIGN, once in the condition below.
This causes nla_put_* calls to be rejected if the allocation size of the message has been strictly calculated by the caller.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
|
|
|
|
| |
Signed-off-by: Thomas Graf <tgraf@suug.ch>
|
|
|
|
|
|
| |
Can't used nla_type() as it applies NLA_TYPE_MASK first
Signed-off-by: Thomas Graf <tgraf@suug.ch>
|
|
|
|
|
|
|
|
| |
Use a debugging message to warn applications if an attribute is
found multiple times in the same message. It is perfectly valid
to rely on this behaviour but it is likely to indicate a bug.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
|
|
|
|
|
|
| |
The kernel will start using type 0 attributes for padding purposes.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
|
|
|
|
|
|
|
| |
Although wasteful, NLA_FLAG with non zero payload cause no harm
and should thus not be rejected.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
|
|
|
|
| |
Signed-off-by: Thomas Graf <tgraf@suug.ch>
|
|
|
|
| |
Signed-off-by: Thomas Graf <tgraf@suug.ch>
|
|
|
|
|
|
|
| |
This clarifies the seperation between public and private
header files.
Signed-off-by: Thomas Graf <tgraf@suug.ch>
|
|
|
|
| |
Signed-off-by: Thomas Graf <tgraf@suug.ch>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
- 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
|
|
|
|
|
| |
Check for empty nested attributes in nla_nest_end() and omit the
attribute alltogether if is is the case.
|
|
|
|
| |
The old symbols are left around for compatibility.
|
|
|
|
|
| |
This could happen if a user put an unaligned amount of data inside
an attribute with nlmsg_append().
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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!
|
|
|
|
|
|
| |
No longer enforce at least one attribute in a container of nested
attributes. The application may do so itself by setting minlen
to NLA_HDRLEN.
|
|
|
|
|
| |
This patch extends and reorganizes the existing attribute documentation
and includes various verbose examples.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Patrick McHardy reported a problem where pointers to the
payload of a netlink message as returned by f.e. the
nesting helpers become stale when the payload data
chunk is reallocated.
In order to avoid further problems, the payload chunk is
no longer extended on the fly. Instead the allocation is
made during netlink message object allocation time with
a default size of a page which should be fine for the
majority of all users. Additionally the functions
nlmsg_alloc_size() and nlmsg_set_default_size() have been
added to allocate messages of a particular length and to
modify the default message size.
|
|
|
|
|
|
| |
Use %td for ptrdiff_t and %zu for size_t.
Signed-off-by: Patrick McHardy <kaber@trash.net>
|
|
|