[AGENT++] [Fwd: snmp++ notify_register/notify_unregister BUG?]

Jochen Katz katz at agentpp.com
Tue Jun 16 21:39:02 CEST 2009


He Sebastian,

you're only allowed to write to the list, if you are subscribed to it.

The answer is: yes this is a bug, the old listen address is used for the
second call, even if notify_unregister is called before.

A fast fix is adding the following line to void
CNotifyEventQueue::DeleteEntry(Snmp *snmp):

@@ -671,6 +671,7 @@
     if (m_notify_fds) delete [] m_notify_fds;
     m_notify_fds = 0;
     m_notify_fd_count = 0;
+    m_notify_addrs.clear();
   }
   unlock();
 }


Sebastian Schuetz schrieb:
> 
> Hi,
> 
> I have been playing with snmp++ and found some "strange" 
> behaviour. I tried to set the listening port to 162 (without beeing
> root) => Permission denied (as expected). Changing the port
> to somewhat higher (e.g. 16000) I still get Permission denied error.
> Closing the application and change the port before doing the
> notify_register stuff everything works fine.
> 
> So I guess, there is some "old state" present, even after doing
> notify_unregister?
> 
> I want to provide the user a chance to specify another port
> at runtime (even if the traditional port fails).
> 
> Did I hit a bug, or am I doing something wrong?
> 
> Thanks in advance,
> 
> cheers
> 
> Sebastian
> 
> btw. pls CC, because I am not subscribed to the list.
> 



More information about the AGENTPP mailing list