summaryrefslogtreecommitdiffstats
path: root/lib/nl.c
Commit message (Collapse)AuthorAgeFilesLines
* lib: avoid overflow in computation of s_seq_nextChristopher Ferris2024-07-191-1/+1
| | | | | | | | | | | | | | | On some systems, the clock is reset, or is lost, so the value returned by the time function can be a very small value. In that case, the _badrandom_from_time function returns a large value close to the maximum unsigned int value for s_seq_next. This can lead to the value wrapping around fairly quickly. When compiling the library with the unsigned-integer-overflow sanitizer enabled, this causes an abort. Detect this potential wrap around condition and avoid it. https://github.com/thom311/libnl/pull/395
* all: fix and enable "-Wsign-compare" warningThomas Haller2024-05-291-4/+5
|
* include: use <linux/$file> instead of <linux-private/linux/$file>Thomas Haller2023-08-081-1/+1
| | | | | | As we now copy all linux headers, and we have include/linux-private in our include search path, just include the linux headers as we commonly do.
* include: include private linux headers with explicit pathThomas Haller2023-08-031-1/+1
| | | | | | | We have copies of the linux headers in include/linux-private. For those files, include the copies explicitly. No practice there is no difference, since we build with :-Ilinux-private".
* include: drop "netlink-private/netlink.h" and move declarationsThomas Haller2023-08-021-2/+2
|
* all: cleanup includes and use "nm-default.h"Thomas Haller2023-08-021-3/+6
|
* include: split and drop "netlink-private/types.h"Thomas Haller2023-08-021-0/+1
| | | | | Move all the declarations from "netlink-private/types.h" to places closer to where they are used.
* lib: move "include/netlink-private/socket.h" to lib/nl-core.hThomas Haller2023-08-011-1/+2
|
* base: move "netlink-private/utils.h" to "base/nl-base-utils.h"Thomas Haller2023-07-311-1/+1
| | | | | | | | | | "base/nl-base-utils.h" (formerly "netlink-private/utils.h") contains no libnl3 specific references, just a bunch of C helpers. It's also a header-only "library", so it can be freely used by all our C-code. Move it to a separate directory, to make that clear.
* license: fix and add SPDX license identifiers and drop license commentsThomas Haller2020-04-161-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also fixes a few wrong SPDX license identifiers, where the original license comment indicates GPL-2.0-only. This is not done manually, but by running the following script: --- #!/bin/bash # Tool to drop license comments, adding SPDX license identifiers, while preserving # copyright comments. The point is not to manually do this task, but perform some # hacked up string replacement. _cp() { /bin/cp "$@" } _cat() { /bin/cat "$@" } in_file() { local T=$(mktemp) _cp -f "$1" "$T" _cat "$T" rm -f "$T" } out_file() { local T=$(mktemp) _cat - > "$T" _cp -f "$T" "$1" rm -f "$T" } join() { _cat "$@" | awk '{ printf("%s#x#", $0)}' } unjoin() { _cat - | sed 's/#x#/\n/g' } files_all() { git ls-files | grep -v '\.png$' | grep -v '^include/linux-private/' } adjust() { NEWLINES='\(#x#\)\+' COPYRIGHTS='\(\( \* Copyright (c) 20..\(-20..\|, 20..\)\? [^#]\+#x#\)\+\( \*#x# \* \(Stolen[^#]*\|Based on [^#]*\)#x#\)\?\)' _cat - | \ sed '1s%^\(/\* SPDX-License-Identifier: LGPL-2.1-only \*/\|\)#x#/\*#x# \* [^#]*#x# \*#x# \*[ ]\+This library is free software; you can redistribute it and/or#x# \*[ ]\+modify it under the terms of the GNU Lesser General Public#x# \*[ ]\+License as published by the Free Software Foundation version 2.1#x# \*[ ]\+of the License.#x# \*#x#'"$COPYRIGHTS"' \*/'"$NEWLINES"'%/\* SPDX-License-Identifier: LGPL-2.1-only \*/#x#/*#x#\2 */#x##x#%' | \ sed '1s%^/\*#x# \* [^#]*#x# \*#x# \*[ ]\+This library is free software; you can redistribute it and/or#x# \*[ ]\+modify it under the terms of the GNU Lesser General Public#x# \*[ ]\+License as published by the Free Software Foundation version 2.1#x# \*[ ]\+of the License.#x# \*/'"$NEWLINES"'%/\* SPDX-License-Identifier: LGPL-2.1-only \*/#x##x#%' | \ sed '1s%^\(\)/\*#x# \* [^#]*#x# \*#x# \*[ ]\+This library is free software; you can redistribute it and/or#x# \*[ ]\+modify it under the terms of the GNU Lesser General Public#x# \*[ ]\+License as published by the Free Software Foundation version 2.1#x# \*[ ]\+of the License.#x# \*#x#'"$COPYRIGHTS"' \*/'"$NEWLINES"'%/\* SPDX-License-Identifier: LGPL-2.1-only \*/#x#/*#x#\2 */#x##x#%' | \ sed '1s%^\(/\* SPDX-License-Identifier: LGPL-2.1-only \*/\|\)#x#/\*#x# \* [^#]*#x# \*#x# \*[ ]\+This library is free software; you can redistribute it and/or#x# \*[ ]\+modify it under the terms of the GNU General Public License as#x# \*[ ]\+published by the Free Software Foundation version 2 of the License.#x# \*#x#'"$COPYRIGHTS"' \*/'"$NEWLINES"'%/\* SPDX-License-Identifier: GPL-2.0-only \*/#x#/*#x#\2 */#x##x#%' } FILES=( $(files_all) ) for f in "${FILES[@]}"; do echo "processing \"$f\"..." in_file "$f" | join | adjust | unjoin | out_file "$f" done
* lib: Don't omit second operand to `?` operatorMichael Forney2019-08-161-1/+1
|
* Add SPDX identifiersYegor Yefremov2019-08-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Software Package Data Exchange identifiers help to detect source file licenses and hence simplify the FOSS compliance process. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> https://github.com/thom311/libnl/pull/219 --- FILES=( lib/addr.c lib/attr.c lib/cache.c lib/cache_mngr.c lib/cache_mngt.c lib/data.c lib/error.c lib/fib_lookup/lookup.c lib/fib_lookup/request.c lib/genl/ctrl.c lib/genl/family.c lib/genl/genl.c lib/genl/mngt.c lib/handlers.c lib/hash.c lib/hashtable.c lib/idiag/idiag.c lib/idiag/idiag_meminfo_obj.c lib/idiag/idiag_msg_obj.c lib/idiag/idiag_req_obj.c lib/idiag/idiag_vegasinfo_obj.c lib/mpls.c lib/msg.c lib/netfilter/ct.c lib/netfilter/ct_obj.c lib/netfilter/exp.c lib/netfilter/exp_obj.c lib/netfilter/log.c lib/netfilter/log_msg.c lib/netfilter/log_msg_obj.c lib/netfilter/log_obj.c lib/netfilter/netfilter.c lib/netfilter/nfnl.c lib/netfilter/queue.c lib/netfilter/queue_msg.c lib/netfilter/queue_msg_obj.c lib/netfilter/queue_obj.c lib/nl.c lib/object.c lib/route/act.c lib/route/addr.c lib/route/class.c lib/route/classid.c lib/route/cls.c lib/route/link.c lib/route/neigh.c lib/route/neightbl.c lib/route/netconf.c lib/route/nexthop.c lib/route/nexthop_encap.c lib/route/nh_encap_mpls.c lib/route/pktloc.c lib/route/qdisc.c lib/route/route.c lib/route/route_obj.c lib/route/route_utils.c lib/route/rtnl.c lib/route/rule.c lib/route/tc.c lib/socket.c lib/utils.c lib/version.c lib/xfrm/ae.c lib/xfrm/lifetime.c lib/xfrm/sa.c lib/xfrm/selector.c lib/xfrm/sp.c lib/xfrm/template.c src/genl-ctrl-list.c src/idiag-socket-details.c src/lib/addr.c src/lib/class.c src/lib/cls.c src/lib/ct.c src/lib/exp.c src/lib/link.c src/lib/neigh.c src/lib/qdisc.c src/lib/route.c src/lib/rule.c src/lib/tc.c src/lib/utils.c src/nf-ct-add.c src/nf-ct-events.c src/nf-ct-list.c src/nf-exp-add.c src/nf-exp-delete.c src/nf-exp-list.c src/nf-log.c src/nf-monitor.c src/nf-queue.c src/nl-addr-add.c src/nl-addr-delete.c src/nl-addr-list.c src/nl-class-add.c src/nl-class-delete.c src/nl-class-list.c src/nl-classid-lookup.c src/nl-cls-add.c src/nl-cls-delete.c src/nl-cls-list.c src/nl-fib-lookup.c src/nl-link-enslave.c src/nl-link-ifindex2name.c src/nl-link-list.c src/nl-link-name2ifindex.c src/nl-link-release.c src/nl-link-set.c src/nl-link-stats.c src/nl-list-caches.c src/nl-list-sockets.c src/nl-monitor.c src/nl-neigh-add.c src/nl-neigh-delete.c src/nl-neigh-list.c src/nl-neightbl-list.c src/nl-pktloc-lookup.c src/nl-qdisc-add.c src/nl-qdisc-delete.c src/nl-qdisc-list.c src/nl-route-add.c src/nl-route-delete.c src/nl-route-get.c src/nl-route-list.c src/nl-rule-list.c src/nl-tctree-list.c src/nl-util-addr.c ) sed '1s#^#/* SPDX-License-Identifier: LGPL-2.1-only */\n#' "${FILES[@]}" -i
* nl: fix function name in debug msgMatthieu Baerts2018-06-251-1/+1
| | | | | | | | | | Just a typo. Fixes: f545295 (lib: log errors from platform) Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net> https://github.com/thom311/libnl/pull/191
* lib: fix comment for nl_recv() about return value for non-blocking readThomas Haller2017-01-201-1/+3
| | | | | | | | 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
* lib: use MSG_PEEK by default for nl_recvmsgs()Thomas Haller2016-11-301-2/+3
| | | | | | | | | | | | | | | The MSG_PEEK API of recvmsg() should be avoid because it requires an additional syscall. But worse is to choose a too small buffer size and failing to receive the message. A user who is aware of the issue can avoid MSG_PEEK by either nl_socket_disable_msg_peek()/nl_socket_enable_msg_peek() or by setting a buffer size via nl_socket_set_msg_buf_size(). By default however we now use MSG_PEEK. This is more important since commit 90c6ebec9bd7a where the link dump request can be rather large. Signed-off-by: Thomas Haller <thaller@redhat.com>
* lib: switch to using strerror_l() instead of strerror_r()André Draszik2016-08-251-17/+9
| | | | | | | | | | | | | | | | | | | | | | | | | glibc provides two versions of strerror_r(), which can be chosen between using feature test macros _GNU_SOURCE and _POSIX_C_SOURCE. libnl is built using the former, hence we get the glibc special version, and all code so far has been written for this. Other C libraries like musl on the other hand only try to be posix compliant, and only ever provide the posix version of strerror_r(), which has a different signature. Uses in libnl hence generally cause printf() of an *int* with a *string format* specifier for that reason. Additionally, strerror_r() has been deprecated: http://austingroupbugs.net/view.php?id=655 Switch to using strerror_l() (via our wrapper just introduced). Signed-off-by: André Draszik <adraszik@tycoint.com> Reviewed-by: Stephane Ayotte <sayotte@tycoint.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* trivial: whitespace-only fixes for src and libPeter Wu2016-08-121-3/+3
| | | | | | | | | | | Fixes alignment, lines with just whitespace and mixed tab/space indentation. Searched, reviewed and optionally fixed in vim using regex ^\t* [\t ]*\([^*us ]\|$\)\|\t\+$ http://lists.infradead.org/pipermail/libnl/2016-August/002183.html Signed-off-by: Peter Wu <peter@lekensteyn.nl> Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnl: don't use out-of-scope buffer in nl_send_iovec()Andrew Vagin2015-11-241-1/+1
| | | | | | | | | | The control message buffer is desclared in the if body and then this buffer is used outside. http://lists.infradead.org/pipermail/libnl/2015-November/002013.html Signed-off-by: Andrew Vagin <avagin@virtuozzo.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnl: report an error if unexpected control data was receivedAndrey Vagin2015-09-211-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, we try to handle MSG_CTRUNC, but if msg_controllen is zero, we make double free for the same address. realloc(0, 0) returns non-zero address realloc(addr, 0) returns zero and free(addr) has already been called Then we call free(addr) again and get an error like this: *** Error in `./task_diag_all': double free or corruption (fasttop): 0x0000000000f9c160 *** ======= Backtrace: ========= /lib64/libc.so.6(+0x77e9d)[0x7f360ed96e9d] /lib64/libc.so.6(+0x7f53c)[0x7f360ed9e53c] /lib64/libc.so.6(cfree+0x4c)[0x7f360eda2e9c] /lib64/libnl-3.so.200(nl_recv+0x221)[0x7f360f2f6361] /lib64/libnl-3.so.200(nl_recvmsgs_report+0x555)[0x7f360f2f6a95] /lib64/libnl-3.so.200(nl_recvmsgs+0x9)[0x7f360f2f6d89] ./task_diag_all[0x400f8d] /lib64/libc.so.6(__libc_start_main+0xf0)[0x7f360ed3f790] ./task_diag_all[0x401169] http://lists.infradead.org/pipermail/libnl/2015-September/001965.html Signed-off-by: Andrey Vagin <avagin@openvz.org> Signed-off-by: Thomas Haller <thaller@redhat.com>
* socket: fix assertion in nl_connect() when all ports are already in useThomas Haller2015-08-241-2/+2
| | | | | | | | | | | | | When generating a port fails a few times (because they are already in used outside of libnl's knowledge), we would back off generating a local port and instead let kernel decide. There was however a bug in nl_connect() that caused an assertion: BUG at file position socket.c:147:_nl_socket_used_ports_release_all app: socket.c:147: _nl_socket_used_ports_release_all: Assertion `0' failed. Fixes: 96e1e5bdc2e803700055395cc3c428fa2525d1ca
* socket: add fallback for nl_connect() by trying to bind to unspecified local ↵Thomas Haller2015-08-141-11/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | port libnl allows the user to explicitly set the local port before connecting the socket. A more convenient way is to leave the local port unspecified and let libnl generate a port id. As it is, generate_local_port() would try at most 1024 ports, that means if a user tries to connect more sockets, the automatism will fail. Kernel also supports choosing the local port itself (via netlink_autobind()). So, this could be fixed by always leaving the port unspecified and let kernel decide on the port. For that we could entirely drop generate_local_port(). There are however problems with that: - it is unclear why generate_local_port() was even introduced in the first place instead of always relying kernel. This code already appeared in libnl-1, so maybe there was a good reason for it or it is necessary on some kernel versions. - The deprecated libnl-1 library also uses a form of generate_local_port(). Its first guess would always be getpid(), but the problem is that it would not retry on EADDRINUSE. Currently libnl-3 generates ports in a different sequence and will not generate a conflicting port (until it already exhausted 1016 other ports). Hence, currently if your application uses libnl1 and libnl3 together, the automatism might just work without conflicts (commit 1f734a8f892abcd3f81637df4a089155aca1b66a). Accidently, kernel/netlink_autobind() also first tries the process id as port. That means, if we change libnl-3 to leave the decision to kernel, and - the application connects sockets both via libnl-1 and libnl-3 - and the libnl-3 socket happens to connect first then the libnl-1 socket would fail to connect without retrying another port. - Removing generate_local_port() entirely changes behavior in the following case: sk = nl_socket_alloc(); /* accessing local port before connecting the socket used to * freeze the local port to the generated value. */ port = nl_socket_get_local_port(sk); nl_connect(sk, NETLINK_...); Maybe the issues are minor and it would simplify the code just to get rid of the cruft. But instead fix the issue without changing behavior. Just keep trying with generate_local_port() first, before fallback to kernel. Reported-by: Julien Courtat <julien.courtat@6wind.com> Signed-off-by: Thomas Haller <thaller@redhat.com> http://lists.infradead.org/pipermail/libnl/2015-June/001889.html
* socket: clear port when unable to generate local portThomas Haller2015-08-141-1/+1
| | | | | | | | | | | | | | | | | | | | When running out of local ports, _nl_socket_generate_local_port_no_release() would leave the socket with port UINT32_MAX. That means if nl_connect() fails due to out-of-ports, it would leave the port id assigned to an invalid port and the socket instance was not re-usable until the user called nl_socket_set_local_port(). Fix that by resetting the local port to zero. Thereby, also change generate_local_port() to return zero when running out of ports. zero is a more natural value for ~no port found~. It also matches the port that _nl_socket_generate_local_port_no_release() uses when failing to generate a port. Also ensure that zero cannot be returned as valid port by generate_local_port(). Arguably, that would only be possible if (getpid() & 0x3FFFFF) returns zero. Just be extra cautious. Signed-off-by: Thomas Haller <thaller@redhat.com>
* lib/nl: add missing headerJörg Krause2015-08-141-0/+1
| | | | | | | | | | | CMSG_NXTHDR requires <linux/socket.h>. This fix a build error with the musl C library: ``` undefined reference to `__cmsg_nxthdr' ``` https://github.com/thom311/libnl/pull/83
* lib: return error if an incomplete message was readThomas Egerer2015-06-051-0/+7
| | | | | | | | | | | | | | | | | | | If recvmsg indicates that the message read was truncated libnl retries to read the complete message after increasing the message buffer. This only works if the message flags MSG_PEEK | MSG_TRUNC are set. If NL_MSG_PEEK is not enabled on the nl_sock structure, flags are left empty and the rest of the truncated message is discarded, hence a subsequent recvmsg returns the next message (in case of a multipart message, the NLMSG_DONE) is read and returned. This patch aborts message processing if the message was truncated and the NL_MSG_PEEK flags was not activated for the nl_sock structure. http://lists.infradead.org/pipermail/libnl/2015-June/001888.html [thaller@redhat.com: add NL_CAPABILITY_NL_RECV_FAIL_TRUNK_NO_PEEK] Signed-off-by: Thomas Egerer <hakke_007@gmx.de> Signed-off-by: Thomas Haller <thaller@redhat.com>
* lib/socket: add nl_socket_set_fd() functionThomas Haller2015-03-051-2/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is based on the patch by sagil@infinidat.com, but heavily modified. Add a function nl_socket_set_fd(), I renamed it from nl_connect_fd(). Now nl_connect() and nl_socket_set_fd() are implemented independently as they share little code. But they have similar functionality: to initialize a libnl socket and set it's file descriptor. A user who wants libnl to setup the socket can continue to use nl_connect(). A user with special requirements should setup the socket entirely. That includes calling socket() (with or without SOCK_CLOEXEC), bind(), setting buffer size. For the same reason I dropped nl_create_fd(). It didn't do much more then calling socket() -- which the user can do directly. https://github.com/thom311/libnl/pull/68 Signed-off-by: Thomas Haller <thaller@redhat.com>
| * add socket nl_connect_fd() & nl_create_fd()Sagi Lowenhardt2015-03-051-21/+79
|/ | | | | | | | | | | | - Added option to create socket (fd) without bind. It is now possible to forward the socket fd to another child process... ...later use nl_connect_fd() to connect to socket from the child process. - Added option to disable CLOEXEC even if defined (in socket.h) 'nl_socket_enable_cloexec' & 'nl_socket_disable_cloexec' No change to current default behavior. Signed-off-by: Sagi Lowenhardt <sagil@infinidat.com>
* lib/nl: preserve s_local if nl_connect() failsThomas Haller2015-03-051-8/+16
| | | | | | | | s_local.nl_pid is used to track the generated port unless NL_OWN_PORT is set. Ensure that getsockname() doesn't overwrite the value and possibly reset the local port manually to release the generated port. Signed-off-by: Thomas Haller <thaller@redhat.com>
* lib/socket: remove NL_SOCK_BUFSIZE_SET socket flagThomas Haller2015-03-051-5/+3
| | | | | | | | | | | | | | | | The flag was not actually used. NL_SOCK_BUFSIZE_SET was only set by nl_socket_set_buffer_size(). Note that you can only call nl_socket_set_buffer_size() on a socket that is already connected via nl_connect(). On first call, nl_connect() would always see NL_SOCK_BUFSIZE_SET unset, and call nl_socket_set_buffer_size(). Since the flag was never unset, when trying to connect a socket a second time, we would not set the buffer size again. Which was a bug. Signed-off-by: Thomas Haller <thaller@redhat.com>
* lib: log errors from platformLubomir Rintel2015-02-171-5/+31
| | | | | | | | | | | | nl_syserr2nlerr() reduces a lot of platform errors to NLE_FAILURE -- "Unspecific failure" which makes it somehow hard to track down the real reason behind a failure. Logging them with level of 4 makes it a little less painful. https://github.com/thom311/libnl/pull/65 Signed-off-by: Thomas Haller <thaller@redhat.com>
* nl: add function nl_pickup_keep_syserr()Thomas Haller2014-11-271-0/+31
| | | | | | | | | | | | nl_pickup() converts error codes from netlink into nl error codes using nl_syserr2nlerr(). The latter function mangles different error codes to the same nl error code. Add a new function, that returns both the nl error code and the original error code. Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
* trival: white space fix in lib/nl.cThomas Haller2014-11-271-9/+9
| | | | | Acked-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: Thomas Haller <thaller@redhat.com>
* lib/socket: retry generate local port in nl_connect on ADDRINUSEThomas Haller2014-05-061-7/+55
| | | | | | | | | | | | | | | | | | | | | It can easily happen that the generated local netlink port is alrady in use. In that case bind will fail with ADDRINUSE. Users of libnl3 could workaround this, by managing the local ports themselves, but sometimes these users are libraries too and they also don't know which ports might be used by other components. This patch changes that nl_socket_alloc() no longer initilizes the local port id immediately. Instead it will be initialized when the user calls nl_socket_get_local_port() the first time and thereby shows interest in the value. If bind() fails with ADDRINUSE, check if the user ever cared about the local port, i.e. whether the local port is still unset. If it is still unset, assume that libnl should choose a suitable port and retry until an unused port can be found. Signed-off-by: Thomas Haller <thaller@redhat.com>
* nl: Fix comment typo on recvmsgsOlaf Hering2013-10-011-1/+1
| | | | Signed-off-by: Olaf Hering <olaf@aepfle.de>
* nl: Increase receive buffer size to 4 pagesThomas Graf2013-05-081-1/+1
| | | | | | | | | | Assuming that the kernel does not send more than a page is no longer valid, and enabling MSG_PEEK'ing by default to figure out the exact message buffer requirements can have a negative influence on the performance of existing applications. Bumping the default receive buffer space to 4 pages seems a sane default. Signed-off-by: Thomas Graf <tgraf@suug.ch>
* nl: Return -NLE_AGAIN if non-blocking socket would blockThomas Graf2013-04-021-5/+0
| | | | | | | | | | Previously 0 was returned which gave the caller no chance of detecting when a non-blocking socket would block. If a caller intends to never see an error message it should utilize poll()/select() to only read when the socket has pending data or information. Reported-by: Holger Eitzenberger <holger@eitzenberger.org> Signed-off-by: Thomas Graf <tgraf@suug.ch>
* Move private header files to <netlink-private/*>Thomas Graf2013-01-241-1/+1
| | | | | | | This clarifies the seperation between public and private header files. Signed-off-by: Thomas Graf <tgraf@suug.ch>
* nl: Improve API doc of nl_send_simple()Thomas Graf2012-11-081-11/+16
| | | | Signed-off-by: Thomas Graf <tgraf@redhat.com>
* nl: Improve API doc of nl_connect() and nl_close()Thomas Graf2012-11-081-9/+23
| | | | Signed-off-by: Thomas Graf <tgraf@redhat.com>
* nl: Allow to overwrite nl_send()Thomas Graf2012-11-081-11/+17
| | | | | | | | Up to now only calls to nl_send_auto() could be overwritten with nl_cb_overwrite_send(). This patch extends the capability to nl_send() Signed-off-by: Thomas Graf <tgraf@redhat.com>
* nl: improve API doc of transmit functionsThomas Graf2012-11-081-51/+154
| | | | Signed-off-by: Thomas Graf <tgraf@redhat.com>
* nl: improve nl_sendto() docs and error checksThomas Graf2012-11-061-5/+27
| | | | | | | Make nl_sendto() return NLE_INVAL if provided buffer is NULL and make it return NLE_BAD_SOCK if the socket is not connected. Add note in docs about lack of NL_CB_MSG_OUT invokation
* nl_recv: fix indent styleThomas Graf2012-11-061-9/+11
|
* nl_recv: return NLE_INVAL if socket address pointer is NULLThomas Graf2012-11-061-1/+1
|
* nl_recv: return NLE_INVAL if buf is NULLThomas Graf2012-11-061-0/+3
|
* nl_recv: improve function documentationThomas Graf2012-11-061-13/+33
|
* nl_recv: Don't update *buf in error pathThomas Graf2012-11-051-3/+2
| | | | iov.iov_base is either NULL or invalid
* Document buffer size limitations of nl_recv()Thomas Graf2012-11-051-0/+7
|
* nl_recv(): work with credentials only if "creds" given and NL_SOCK_PASSCRED setКоренберг Марк (дома)2012-10-191-12/+15
|
* nl_recv(): small code cleanupsКоренберг Марк (дома)2012-10-191-8/+4
| | | | | 1. memset around nla is unnecessary 2. calloc() is unnecessary. malloc() used instead.
* nl_recv(): EWOULDBLOCK return value also checkedКоренберг Марк (дома)2012-10-191-3/+2
|