[AGENT++] (no subject)

Pham, My V. (Mission Systems) My.Pham at ngc.com
Thu Jan 31 01:37:52 CET 2008


Hello, 

I noticed these lines in agent++ source code:

NotificationOriginator::generate(...)
{
   ...

   int totalStatus = SNMP_ERROR_SUCCESS;
   ...

   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?

Thanks, 
My



More information about the AGENTPP mailing list