Hi,

I have noticed that the handling of the Target Address Table ( see
snmpTargetAddrTable_create()) and Target Parameters Table (see
snmpTargetParamTable_create()) during a HUP is not actually done if
callbacks are enabled.

For example, init_snmpTargetAddrEntry() should register a callback for
the SNMPD_CALLBACK_PRE_UPDATE_CONFIG to handle the shutdown of the
Target Address Table. This is how it is currently done for the
Notificaitons Table via:

snmp_register_callback(SNMP_CALLBACK_APPLICATION,
                           SNMPD_CALLBACK_PRE_UPDATE_CONFIG,
                           notifyTable_unregister_notifications, NULL);


The result of this incomplete handling of HUP for the Target Address
and Target Parameters Tables is:
-sockets which are created for each trap sink are never closed (thus
causing File Handle leaks)
-the data structures related to these Tables are never freed (thus
causing memory leaks)

I have attempted my own fix by implementing the above, but for some
reason I have encountered some sort of memory corruption- when the
config files are reloaded after the HUP is received,
vacm_createViewEntry() is called, which in turn calls callocs() which
result in a crash. I found that commenting out SNMP_FREE(t->remote) in
netsnmp_transport_free() stops this problem, but then without the
SNMP_FREE() we will still have memory leaks.

Can someone please suggest an alternate fix? Tested on v5.6 and v5.6.1.

Cheers,
Daniel

------------------------------------------------------------------------------
Benefiting from Server Virtualization: Beyond Initial Workload 
Consolidation -- Increasing the use of server virtualization is a top
priority.Virtualization can reduce costs, simplify management, and improve 
application availability and disaster protection. Learn more about boosting 
the value of server virtualization. http://p.sf.net/sfu/vmware-sfdev2dev
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to