When is the errindex supposed to be set to the appropriate value in the response PDU for an SNMP SET request that fails?
Thank you!
When is the errindex supposed to be set to the appropriate value in the
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You actually don’t set the error-index using the Net-SNMP API. The problem is that your loop over the requests should actually always return SNMPERR_SUCCESS to indicate the handler succeeded even if some of the SNMP request components didn’t.
To indicate a particular request failed with an error message, you would use the following API:
netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);for example. For picking the correct error to return, please see section 4.2.5 in RFC3416 which has a nice step-by-step procedure for returning the right error code for a given situation.