summaryrefslogtreecommitdiff
path: root/lib/libagentx
diff options
context:
space:
mode:
authorMartijn van Duren <martijn@cvs.openbsd.org>2023-10-24 08:54:53 +0000
committerMartijn van Duren <martijn@cvs.openbsd.org>2023-10-24 08:54:53 +0000
commit52ec65986ea7fda75be9564df77bc5ab27c28055 (patch)
tree6870fd6e60918d24dcc65bfa158812f7785fcc0a /lib/libagentx
parentc73e4eb09e221fe2ad8136d2daa7c295a1f428db (diff)
According to RFC2741 section 6.1.1 an agentx-response-pdu shouldn't have
the NON_DEFAULT_CONTEXT set. Remove the argument from ax_response(). OK tb@
Diffstat (limited to 'lib/libagentx')
-rw-r--r--lib/libagentx/agentx.c6
-rw-r--r--lib/libagentx/ax.c8
-rw-r--r--lib/libagentx/ax.h5
3 files changed, 8 insertions, 11 deletions
diff --git a/lib/libagentx/agentx.c b/lib/libagentx/agentx.c
index 07993b7c847..cc43ad45740 100644
--- a/lib/libagentx/agentx.c
+++ b/lib/libagentx/agentx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: agentx.c,v 1.22 2022/12/27 17:10:05 jmc Exp $ */
+/* $OpenBSD: agentx.c,v 1.23 2023/10/24 08:54:52 martijn Exp $ */
/*
* Copyright (c) 2019 Martijn van Duren <martijn@openbsd.org>
*
@@ -2733,8 +2733,7 @@ agentx_get_finalize(struct agentx_get *axg)
free(logmsg);
if (ax_response(ax->ax_ax, axs->axs_id, axg->axg_transactionid,
- axg->axg_packetid, AGENTX_CONTEXT_CTX(axc), 0, error, index,
- vbl, nvarbind) == -1) {
+ axg->axg_packetid, 0, error, index, vbl, nvarbind) == -1) {
agentx_log_axg_warn(axg, "Couldn't parse request");
agentx_reset(ax);
} else
@@ -4041,7 +4040,6 @@ agentx_read(struct agentx *ax)
if (ax_response(ax->ax_ax, axs->axs_id,
pdu->ap_header.aph_transactionid,
pdu->ap_header.aph_packetid,
- axc == NULL ? NULL : AGENTX_CONTEXT_CTX(axc),
0, error, 1, NULL, 0) == -1)
agentx_log_axc_warn(axc,
"transaction: %u packetid: %u: failed to send "
diff --git a/lib/libagentx/ax.c b/lib/libagentx/ax.c
index 5e1b0e0c195..4377a82d680 100644
--- a/lib/libagentx/ax.c
+++ b/lib/libagentx/ax.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ax.c,v 1.9 2023/10/24 08:48:41 martijn Exp $ */
+/* $OpenBSD: ax.c,v 1.10 2023/10/24 08:54:52 martijn Exp $ */
/*
* Copyright (c) 2019 Martijn van Duren <martijn@openbsd.org>
*
@@ -553,11 +553,11 @@ ax_unregister(struct ax *ax, uint32_t sessionid,
int
ax_response(struct ax *ax, uint32_t sessionid, uint32_t transactionid,
- uint32_t packetid, struct ax_ostring *context, uint32_t sysuptime,
- uint16_t error, uint16_t index, struct ax_varbind *vblist, size_t nvb)
+ uint32_t packetid, uint32_t sysuptime, uint16_t error, uint16_t index,
+ struct ax_varbind *vblist, size_t nvb)
{
if (ax_pdu_header(ax, AX_PDU_TYPE_RESPONSE, 0, sessionid,
- transactionid, packetid, context) == -1)
+ transactionid, packetid, NULL) == -1)
return -1;
if (ax_pdu_add_uint32(ax, sysuptime) == -1 ||
diff --git a/lib/libagentx/ax.h b/lib/libagentx/ax.h
index 17fe584c877..f4de378f238 100644
--- a/lib/libagentx/ax.h
+++ b/lib/libagentx/ax.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ax.h,v 1.4 2021/01/02 01:06:31 rob Exp $ */
+/* $OpenBSD: ax.h,v 1.5 2023/10/24 08:54:52 martijn Exp $ */
/*
* Copyright (c) 2019 Martijn van Duren <martijn@openbsd.org>
*
@@ -220,8 +220,7 @@ uint32_t ax_register(struct ax *, uint8_t, uint32_t,
uint32_t ax_unregister(struct ax *, uint32_t, struct ax_ostring *,
uint8_t, uint8_t, struct ax_oid *, uint32_t);
int ax_response(struct ax *, uint32_t, uint32_t, uint32_t,
- struct ax_ostring *, uint32_t, uint16_t, uint16_t,
- struct ax_varbind *, size_t);
+ uint32_t, uint16_t, uint16_t, struct ax_varbind *, size_t);
void ax_pdu_free(struct ax_pdu *);
void ax_varbind_free(struct ax_varbind *);
const char *ax_error2string(enum ax_pdu_error);