SNMP: set commit fail error

This commit is contained in:
Olof hagsand 2022-10-09 11:11:17 +02:00
parent dd1e5966fb
commit d2c3b903f1
2 changed files with 7 additions and 5 deletions

View file

@ -753,6 +753,7 @@ clixon_snmp_scalar_handler1(netsnmp_mib_handler *handler,
goto done; goto done;
if (ret == 0){ if (ret == 0){
clicon_rpc_discard_changes(sh->sh_h); clicon_rpc_discard_changes(sh->sh_h);
retval = SNMP_ERR_COMMITFAILED;
goto done; goto done;
} }
break; break;
@ -1227,10 +1228,10 @@ snmp_table_getnext(clicon_handle h,
/*! SNMP table operation handler /*! SNMP table operation handler
* *
* @param[in] handler Registered MIB handler structure * @param[in] handler Registered MIB handler structure
* @param[in] nhreg Root registration info. * @param[in] nhreg Root registration info.
* @param[in] reqinfo Agent transaction request structure * @param[in] reqinfo Agent transaction request structure
* @param[in] request The netsnmp request info structure. * @param[in] request The netsnmp request info structure.
*/ */
static int static int
clixon_snmp_table_handler1(netsnmp_mib_handler *handler, clixon_snmp_table_handler1(netsnmp_mib_handler *handler,
@ -1310,6 +1311,7 @@ clixon_snmp_table_handler1(netsnmp_mib_handler *handler,
goto done; goto done;
if (ret == 0){ if (ret == 0){
clicon_rpc_discard_changes(sh->sh_h); clicon_rpc_discard_changes(sh->sh_h);
retval = SNMP_ERR_COMMITFAILED;
goto done; goto done;
} }
break; break;

View file

@ -198,7 +198,7 @@ clixon_snmp_input_cb(int s,
clicon_handle h = (clicon_handle)arg; clicon_handle h = (clicon_handle)arg;
int ret; int ret;
clicon_debug(1, "%s %d", __FUNCTION__, s); clicon_debug(2, "%s %d", __FUNCTION__, s);
FD_ZERO(&readfds); FD_ZERO(&readfds);
FD_SET(s, &readfds); FD_SET(s, &readfds);
(void)snmp_read(&readfds); (void)snmp_read(&readfds);