From d2c3b903f1238731d52c2c4e0d876be18cd32baa Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Sun, 9 Oct 2022 11:11:17 +0200 Subject: [PATCH] SNMP: set commit fail error --- apps/snmp/snmp_handler.c | 10 ++++++---- apps/snmp/snmp_main.c | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/snmp/snmp_handler.c b/apps/snmp/snmp_handler.c index 1f46dd64..6c509c8c 100644 --- a/apps/snmp/snmp_handler.c +++ b/apps/snmp/snmp_handler.c @@ -753,6 +753,7 @@ clixon_snmp_scalar_handler1(netsnmp_mib_handler *handler, goto done; if (ret == 0){ clicon_rpc_discard_changes(sh->sh_h); + retval = SNMP_ERR_COMMITFAILED; goto done; } break; @@ -1227,10 +1228,10 @@ snmp_table_getnext(clicon_handle h, /*! SNMP table operation handler * - * @param[in] handler Registered MIB handler structure - * @param[in] nhreg Root registration info. - * @param[in] reqinfo Agent transaction request structure - * @param[in] request The netsnmp request info structure. + * @param[in] handler Registered MIB handler structure + * @param[in] nhreg Root registration info. + * @param[in] reqinfo Agent transaction request structure + * @param[in] request The netsnmp request info structure. */ static int clixon_snmp_table_handler1(netsnmp_mib_handler *handler, @@ -1310,6 +1311,7 @@ clixon_snmp_table_handler1(netsnmp_mib_handler *handler, goto done; if (ret == 0){ clicon_rpc_discard_changes(sh->sh_h); + retval = SNMP_ERR_COMMITFAILED; goto done; } break; diff --git a/apps/snmp/snmp_main.c b/apps/snmp/snmp_main.c index 28fb9321..8c41e1cd 100644 --- a/apps/snmp/snmp_main.c +++ b/apps/snmp/snmp_main.c @@ -198,7 +198,7 @@ clixon_snmp_input_cb(int s, clicon_handle h = (clicon_handle)arg; int ret; - clicon_debug(1, "%s %d", __FUNCTION__, s); + clicon_debug(2, "%s %d", __FUNCTION__, s); FD_ZERO(&readfds); FD_SET(s, &readfds); (void)snmp_read(&readfds);