summaryrefslogtreecommitdiffstats
path: root/lib/libcasper
diff options
context:
space:
mode:
authoroshogbo <oshogbo@FreeBSD.org>2015-05-02 17:45:52 +0000
committeroshogbo <oshogbo@FreeBSD.org>2015-05-02 17:45:52 +0000
commitcf66982b37ec7230cc55175c994e05c6176e8e22 (patch)
treea69b34916c7078793947216a35639f78cd60366e /lib/libcasper
parent843dbc5981a1de860cdd7de6cf7aaf65c87a56ab (diff)
downloadFreeBSD-src-cf66982b37ec7230cc55175c994e05c6176e8e22.zip
FreeBSD-src-cf66982b37ec7230cc55175c994e05c6176e8e22.tar.gz
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)
Diffstat (limited to 'lib/libcasper')
-rw-r--r--lib/libcasper/libcasper.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libcasper/libcasper.c b/lib/libcasper/libcasper.c
index 7545baa..cb95346 100644
--- a/lib/libcasper/libcasper.c
+++ b/lib/libcasper/libcasper.c
@@ -279,7 +279,7 @@ casper_message(const cap_channel_t *capcas, struct service *service)
const char *cmd;
nvlist_t *nvl;
- nvl = cap_recv_nvlist(capcas);
+ nvl = cap_recv_nvlist(capcas, 0);
if (nvl == NULL)
pjdlog_exit(1, "Unable to receive message from Casper");
cmd = nvlist_get_string(nvl, "cmd");
@@ -297,7 +297,7 @@ service_message(struct service *service, struct service_connection *sconn)
const char *cmd;
int error;
- nvlin = cap_recv_nvlist(service_connection_get_chan(sconn));
+ nvlin = cap_recv_nvlist(service_connection_get_chan(sconn), 0);
if (nvlin == NULL) {
if (errno == ENOTCONN) {
pjdlog_debug(1, "Connection closed by the client.");
OpenPOWER on IntegriCloud