Hi all,
I have a trap callback function that checks the trap name against a list
of predefined names and resend the traps to other hosts if the trap name
matches a name in the list. This seems to work properly and I receive
the forwarded traps on the received hosts with the correct trap names
and values. In my test, I generate a trap every 5 seconds or so, after
about 40 traps are forwarded, the agent seems to exit without a core
dump.
This is the gist of my code:
snmp_sess_init( &session );
session.peername = "172.30.250.211:162";
session.version = SNMP_VERSION_2c;
ss = snmp_sess_open( &session );
snmp_sess_send( ss, pdu ); // pdu is passed in the callback
snmp_sess_close( ss );
The message log from the agent seems to indicate that the crash
occurred at the malloc call in _copy_varlist() where malloc returned a
bad pointer (not NULL).
I have tried to use the traditional snmp_open/snmp_send/snmp_close with
the same result.
Can you please give me some help with this problem. Is it legal to
resend traps in a trap callback function? Did I miss some important
setup/cleanup call in my code?
Thanks for your help.
Don
The information contained in this e-mail message is PRIVATE. It may contain
confidential information and may be legally privileged. It is intended for the
exclusive use of the addressee(s). If you are not the intended recipient, you
are hereby notified that any dissemination, distribution or reproduction of
this communication is strictly prohibited. If the intended recipient(s) cannot
be reached or if a transmission problem has occurred, please notify the sender
immediately by return e-mail and destroy all copies of this message.
Thank you.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders