History log of /freebsd-current/lib/libnv/tests/nvlist_send_recv_test.c
Revision Date Author Comments
# a2f733ab 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

lib: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 7c9948c2 02-Jan-2022 Robert Wing <rew@FreeBSD.org>

skip test case nvlist_send_recv__send_many_fds__dgram

If I'm not mistaken, the underlying sendmsg() for nvlist_send() is
failing with ENOBUFS. In turn, nvlist_recv() returns NULL because it
didn't receive the expected number of file descriptors.

Adjusting net.local.dgram.recvspace worked on my local machine, but on
CI the test still fails consistently.

PR: 260891


# a7cb27ce 20-Dec-2021 Robert Wing <rew@FreeBSD.org>

libnv: bump sysctl for nvlist_send_recv__send_many_fds__dgram test

Increase sysctl net.local.dgram.recvspace to 1M.

Reported by: Jenkins


# 5916ae1f 06-Dec-2021 Robert Wing <rew@FreeBSD.org>

libnv: read entire datagram in nvlist_recv()

When SOCK_DGRAM is used, a portion of the datagram is discarded during
the initial recv() when getting the nvlist_header.

To workaround this, use MSG_PEEK for the initial recv() when using a
datagram socket.

Add tests for SOCK_DGRAM with nvlist_send()/nvlist_recv().

Differential Revision: https://reviews.freebsd.org/D32722


# dd8bacfd 16-Jul-2019 Mark Johnston <markj@FreeBSD.org>

Add a regression test which transfers varying number of rights.

This exercises the PKG_MAX_SIZE limit mentioned in r350054.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation


# ccf7f846 16-Jul-2019 Mark Johnston <markj@FreeBSD.org>

Convert the nvlist send/recv tests to ATF.

MFC after: 1 week
Sponsored by: The FreeBSD Foundation


# 908d1eef 14-Apr-2019 Mariusz Zaborski <oshogbo@FreeBSD.org>

libnv: extend the tests

Add cases for sending file descriptors.

Submitted by: Mindaugas Rasiukevicius <rmind@noxt.eu>
MFC after: 2 weeks


# b5d787d9 10-Feb-2019 Mariusz Zaborski <oshogbo@FreeBSD.org>

libnv: fix memory leaks

nvpair_create_stringv: free the temporary string; this fix affects
nvlist_add_stringf() and nvlist_add_stringv().

nvpair_remove_nvlist_array (NV_TYPE_NVLIST_ARRAY case): free the chain
of nvpairs (as resetting it prevents nvlist_destroy() from freeing it).
Note: freeing the chain in nvlist_destroy() is not sufficient, because
it would still leak through nvlist_take_nvlist_array(). This affects
all nvlist_*_nvlist_array() use

Submitted by: Mindaugas Rasiukevicius <rmind@netbsd.org>
Reported by: clang/gcc ASAN
MFC after: 2 weeks


# 991666ad 13-Nov-2018 Mark Johnston <markj@FreeBSD.org>

Ensure that libnv can be used when kern.trap_enotcap=1.

libnv used fcntl(fd, F_GETFL) to test whether fd is a valid file
descriptor. Aside from being racy, this check requires CAP_FCNTL
rights on fd. Instead, use fcntl(fd, F_GETFD), which does not require
any capability rights.

Also remove some redundant fd_is_valid() checks to avoid extra system
calls; in many cases we were performing this check immediately before
dup()ing the descriptor.

Reviewed by: cem, oshogbo (previous version)
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D17963


# c36e54bb 02-Jul-2015 Mariusz Zaborski <oshogbo@FreeBSD.org>

Let the nv.h and dnv.h includes be only in sys directory.

Change consumers to include those files from sys.
Add duplicated files to ObsoleteFiles.

Approved by: pjd (mentor)


# bd1da0a0 02-May-2015 Mariusz Zaborski <oshogbo@FreeBSD.org>

Approved, oprócz użycie RESTORE_ERRNO() do ustawiania errno.

Change the nvlist_recv() function to take additional argument that
specifies flags expected on the received nvlist. Receiving a nvlist with
different set of flags than the ones we expect might lead to undefined
behaviour, which might be potentially dangerous.

Update consumers of this and related functions and update the tests.

Approved by: pjd (mentor)

Update man page for nvlist_unpack, nvlist_recv, nvlist_xfer, cap_recv_nvlist
and cap_xfer_nvlist.

Reviewed by: AllanJude
Approved by: pjd (mentor)


# 2dfd9979 28-Feb-2015 Ryan Stone <rstone@FreeBSD.org>

Extend the unit test to fix the bug caught in r277925

Differential Revision: https://reviews.freebsd.org/D1888
MFC After: 1 month
Sponsored by: Sandvine Inc.


# b236bcf1 05-Aug-2014 Enji Cooper <ngie@FreeBSD.org>

Integrate lib/libnv into the build/kyua

Rename all of the TAP test applications from <test> to <test>_test
to match the convention described in the TestSuite wiki page

Phabric: D538
Approved by: jmmv (mentor)
Sponsored by: EMC / Isilon Storage Division