Title: Restarting the Net-SNMP agent in a threaded environment.

Hi all, I am evaluating porting the Net-SNMP (5.2.1) to a thread environment platform.

Only one thread of SNMP agent will run at the time.

However stopping and starting the SNMP agent is a requirement.

When I look at the code in snmpd.cxx I see:

        receive();

#include "mib_module_shutdown.h"

    DEBUGMSGTL(("snmpd/main", "sending shutdown trap\n"));

    SnmpTrapNodeDown();

    DEBUGMSGTL(("snmpd/main", "Bye...\n"));

    snmp_shutdown("snmpd");

#ifdef SHUTDOWN_AGENT_CLEANLY /* broken code */

    /* these attempt to free all known memory, but result in double frees */

    shutdown_master_agent();

    shutdown_agent();

#endif

A few questions:

Is it safe to use the code under SHUTDOWN_AGENT_CLEANLY to shutdown the agent?

Will it successfully clean all the memory and resources allocated? (like the open sockets for instance...)

If the code is really broken as the comments states what will it take to fix it?

Thanks for your help!

Shuki Sasson
Principal Engineer, Network Storage Group
EMC²
where information lives

Fax: 508 305 9026  
Phone: 508 305 8515
Cell: 617 834 4258
Pager: 877 919 0794 
Email: [EMAIL PROTECTED]

Reply via email to