| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
uClibc doesn't implement strerror_l() and thus libnl starting from
3.2.29 couldn't be compiled with it any longer.
To work-around that problem we'll just do a check on strerror_l()
availability during configuration and if it's not there just fall back
to locale-less strerror().
See-also: 6c2d111177e91184073c44f83d4a6182aaba06d7
http://lists.infradead.org/pipermail/libnl/2017-March/002301.html
Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It would be desirable not to include kernel headers in our public
libnl3 headers. As a test, remove all those includes, and fix
compilation by explicitly including the kernel headers where needed.
In some cases, that requires forward declaration for kernel
structures, as we use them as part of our own headers.
Realistically, we cannot drop those includes as it probalby breaks
compilation for users that expect to get a certain kernel header
when including a libnl3 header. So, this will not be done and the
includes will be restored in the next commit.
Do this step to show how it would be and to verify that we could
build with such a change. The reason not to do this is backward
compatibility (at compile-time).
|
|
|
|
|
|
|
| |
and xfrmnl_sp_set_sec_ctx(). The user already must pass a NUL
terminated string, where the NUL is included in ctx_len.
Just allocate one more by and ensure the buffer is '\0' terminated.
|
|
|
|
|
|
|
|
|
|
| |
The previous API of xfrmnl_sp_get_sec_ctx() is totally broken,
as it requires all out-arguments to be set. The user can thus
not know how large the ctx_str buffer must be.
Fix the API by allowing all arguments to be optional. Thus,
a user can first query the size only, and then in a second
step query the ctx_str. Previous version are broken.
|
|
|
|
|
| |
Mixed up boolean operators in commit f38fb7a.
This commit is the appropriate fix.
|
| |
|
|
|
|
|
| |
security policy can be identified with direction, selector and security context
too. Therefore the code to append approptiate data to delete message is added.
|
|
|
|
|
|
|
|
| |
Identification of policy are possible with:
1. direction and index
2. direction and selector
Theoretically second one needs a security context, but non existing context is
valid too.
|
| |
|
|
|
|
|
|
| |
Fixed xfrmnl_sp->sec_ctx length parameters in xfrmnl_sp_set_sec_ctx,
because former use of only one value wasn't right.
Therefore parameter len is unsued and could be removed.
|
|
|
|
|
| |
Index is not needed and not known if adding a policy. Seems to be copied from
build_xfrm_sp_delete_message.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fdb cache is per bridge and hence hashed by:
<bridge_ifindex, family, mac>
newer kernels send bridge ifindex in NDA_MASTER.
Use NDA_MASTER for neigh->n_master when available.
Also imports a few more NDA_* attributes from upstream
to keep linux/neighbour.h NDA_* attributes in sync with
upstream.
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In general, libnl functions are not robust against calling with
invalid arguments. Thus, never call libnl functions with invalid
arguments. In case of nlmsg_reserve() this means never provide
a @len argument that causes overflow.
Still, add an additional safeguard to avoid exploiting such bugs.
Assume that @pad is a trusted, small integer.
Assume that n->nm_size is a valid number of allocated bytes (and thus
much smaller then SIZE_T_MAX).
Assume, that @len may be set to an untrusted value. Then the patch
avoids an integer overflow resulting in reserving too few bytes.
|
|
|
|
|
|
|
|
| |
Since commit 375a6294a41e003f873821a01d947f0ecfaf76d4, nl_recv()
would fail with -NLE_AGAIN if there is nothing to read. Fix the
documentation.
https://github.com/thom311/libnl/issues/129
|
|
|
|
|
|
|
|
|
|
| |
Now that all -Wmissing-prototypes warnings are fixed, add it to the
default CPPFLAGS.
This should hopefully prevent additions of public functions with wrong
prototype or no prototype at all to the public header.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
|
|
|
|
|
|
|
| |
Older versions of flex (namely the one used on Travis CI) don't properly
emit function prototypes for ematch_get_column() and
ematch_set_column(), leading to GCC -Wmissing-prototypes warnings. Fix
them by manually adding these prototypes.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
|
|
|
|
|
|
|
| |
Older versions of flex (namely the one used on Travis CI) don't properly
emit function prototypes for pktloc_get_column() and
pktloc_set_column(), leading to GCC -Wmissing-prototypes warnings. Fix
them by manually adding these prototypes.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Include the own public header in order to get function prototypes for
all public functions defined in this module.
This fixes GCC -Wmissing-prototype warnings.
Also adjust the implementation of xfrmnl_user_tmpl_set_family() to match
the declaration (family parameter is unsigned int, not int).
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Include the own public header in order to get function prototypes for
all public functions defined in this module.
This fixes GCC -Wmissing-prototype warnings.
Also adjust the implementation of xfrmnl_sel_set_family() to match the
declaration (family parameter is unsigned int, not int).
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Include the own public header in order to get function prototypes for
all public functions defined in this module.
This fixes GCC -Wmissing-prototype warnings.
Also adjust the function prototype of xfrmnl_sa_get_sec_ctx() to
match the definition.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
|
|
|
|
|
|
|
| |
Include the own public header in order to get function prototypes for
all public functions defined in this module.
This fixes GCC -Wmissing-prototype warnings.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
|
|
|
|
|
|
|
| |
Include the own public header in order to get function prototypes for
all public functions defined in this module.
This fixes GCC -Wmissing-prototype warnings.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
|
|
|
|
|
|
|
| |
Avoid a GCC -Wmissing-prototypes warning by explicitely adding a
prototype for the ABI-preserving wrapper added in commit 8d04ebf55400
("lib/route: preserve old ABI for rtnl_link_get_pmtudisc()") and add an
explanatory comment.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
|
|
|
|
|
|
|
| |
Include the own public header in order to get function prototypes for
all public functions defined in this module.
This fixes GCC -Wmissing-prototype warnings
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
|
|
|
|
|
|
|
| |
Include the own public header in order to get function prototypes for
all public functions defined in this module.
This fixes GCC -Wmissing-prototype warnings.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
|
|
|
|
|
|
|
| |
Include the own public header in order to get function prototypes for
all public functions defined in this module.
This fixes GCC -Wmissing-prototype warnings.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
|
|
|
|
|
|
|
| |
Include the own public header in order to get function prototypes for
all public functions defined in this module.
This fixes GCC -Wmissing-prototype warnings.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
|
|
| |
https://github.com/thom311/libnl/issues/124
|
|
|
|
|
|
|
|
|
|
| |
Add O_CLOEXEC to various fopen() calls. This avoids file descriptors
leaking across an exec() boundary in a multi-threaded program. Please
see "man 2 open" for additional information about O_CLOEXEC.
Signed-off-by: Nick Kralevich <nnk@google.com>
https://github.com/thom311/libnl/pull/128
|
|
|
|
|
|
|
|
|
| |
Let's add a mutex to get_psched_settings() hoping to solve worst
case scenarios when calling get_psched_settings() from multiple
threads.
Also, only read the environment variables once, who knows whether
they are modified concurrently.
|
|
|
|
| |
nl_us2ticks()/nl_ticks2us()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rather than initializing user_hz and psched_hz when libnl is loaded,
defer initialization of these variables to the first time they are used.
This has several advantages:
1) Avoids an unnecessary permission denied error on /proc/net/psched,
which can occur on systems where /proc/net isn't readable due to
security policy.
2) Allows program code to initialize the environment variables
PROC_NET_PSCHED and/or PROC_ROOT prior to the first libnl call, giving a
program more flexibility about where libnl should look.
3) Trivially faster startup time (although unlikely to be significant).
4) Compiler may be able to prove that the get_psched_settings() function
is unreachable and optimize appropriately, because the callers never
(directly or indirectly) use this method. This could occur, for
instance, in doing dead code elimination for programs which statically
link libnl.
Signed-off-by: Nick Kralevich <nnk@google.com>
https://github.com/thom311/libnl/pull/123
|
|
|
|
|
|
| |
Fixes: 5d6e43ebef12deadf31fccfa46c0b34892675d36
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
vf_vlan_info was incorrectly indexed with "len" (the length in bytes
of the entire vfinfo_list rather than list_len (the index of the
current end of the vf_vlan_info array)
https://github.com/thom311/libnl/issues/126
http://lists.infradead.org/pipermail/libnl/2017-January/002270.html
Fixes: 5d6e43ebef12deadf31fccfa46c0b34892675d36
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The public prototype and the last internal user of the function were
removed in commit 8eb5b5532e ("Unified TC API") and it was unexported in
commit 4280dfb85d ("build: don't export internal symbols"), so it is
safe to remove it.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
https://github.com/thom311/libnl/pull/122
|
|
|
|
| |
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
| |
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
|
|
|
|
| |
Document that the SCI is in network order while the port is in host
order.
Signed-off-by: Beniamino Galvani <bgalvani@redhat.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
The commit changed the API from libnl 3.2.28: restore the old
behavior.
This reverts commit cd758fbfee07768ff200f46d7090fa8d0e6b300f.
Signed-off-by: Beniamino Galvani <bgalvani@redhat.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
|
|
|
|
|
| |
_nl_offsetofend()
Kernel calls a very similar macro "offsetofend". So use that name
as it migth be more familiar to the reader.
Signed-off-by: Thomas Haller <thaller@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
| |
The doxygen comment of rtnl_link_get_carrier_changes still describes the
initially implemented behaviour and was not updated, when the signature
was changed as part of #119. Adjust it accordingly.
Fixes: 0c4b2ea6d17b ("link: add support for IFLA_CARRIER_CHANGES")
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
https://github.com/thom311/libnl/pull/120
|
|
|
|
| |
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
|
|
| |
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
|
|
| |
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
|
|
|
|
| |
Also expose the attribute value via link_dump_details()
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
|
|
|
|
|
|
|
| |
Signed-off-by: Sushma Sitaram <sushma.sitaram@intel.com>
Signed-off-by: Thomas Haller <thaller@redhat.com>
http://lists.infradead.org/pipermail/libnl/2016-November/002249.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix the following GCC warning, introduced in commit 66d032ad443a
("cache_mngr: add include callback v2"):
cache.c: In function ‘cache_include.isra.3’:
cache.c:810:6: warning: ‘diff’ may be used uninitialized in this function [-Wmaybe-uninitialized]
cb_v2(cache, clone, obj, diff,
^
Also don't redeclare the uint64_t diff variable, to avoid shadowing.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
Signed-off-by: Thomas Haller <thaller@redhat.com>
Fixes: 66d032ad443a9d67bd26ed3e801cddf9f0e71ae7
http://lists.infradead.org/pipermail/libnl/2016-December/002258.html
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds change_func_v2_t to add a more detailed callback in
case of a cache change. The change function is registered using the new
nl_cache_mngr_add_cache_v2. In case the new change function is set,
nl_cache_include_v2 and thus cache_include_v2 will be used to perform the cache
inclusion.
The parameter of change_func_v2_t are the following:
* struct nl_cache * => cache
* struct nl_object * => the old/deleted nl_object
* struct nl_object * => the new nl_object
* uint64_t => the result of nl_object_diff64 in case of a change
* int => NL_ACT_*
* void * => data
https://github.com/thom311/libnl/issues/71
http://lists.infradead.org/pipermail/libnl/2016-September/002214.html
http://lists.infradead.org/pipermail/libnl/2016-October/002229.html
http://lists.infradead.org/pipermail/libnl/2016-November/002250.html
|