[AGENT++] (no subject)

Jochen Katz katz at agentpp.com
Thu Feb 7 20:52:29 CET 2008


Hi.


> NotificationOriginator::generate(...)
> {
>    ...
>    if (check_access(cur, nop)) {
>       int status = send_notify(cur, nop, notify);
>       if (status != SNMP_ERROR_SUCCESS)
>          totalStatus = status;
>       delete nop.target;
>    ...
>    return totalStatus; 
> }
> 
> Since there's no else block after the "if", the status =
> SNMP_ERROR_SUCCESS is returned when check_access() fails, such as when
> an invalid contextName is passed in and no notification was actually
> sent out.  Shouldn't status be set to SNMP_ERROR_NO_ACCESS or some other
> error for the case when check_access() fails?  This may not matter for
> traps but it may for informs where a response is expected to consider
> the notify was successful?

that just depends on the intention behind the return code. With this
implementation, you only get an error, if a trap/inform that should have
been sent, produced an error. In other words: totalStatus does not
detect false configurations in the tables, but it detects, if a
management station could not be informed.


Regards,
  Jochen



More information about the AGENTPP mailing list