snmp agent not closing trap socket resulting in resource leak

vishal kumar <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <CAF2X0Z9FXnU0Ro2N3VEN1LPJxqngr0JJ-QroQVThErsCu-bd-w@mail.gmail.com>
snmp agent is not releasing the socket created for sending traps to
configured manages:

create_trap_session2(const char *sink, const char* sinkport,
                     char *com, int version, int pdutype)
{

    netsnmp_transport *t;
    netsnmp_session session, *sesp;

    memset(&session, 0, sizeof(netsnmp_session));
    session.version = version;
    if (com) {
        session.community = (u_char *) com;
        session.community_len = strlen(com);
    }
...................................................................................
...................................................................................
t = netsnmp_tdomain_transport_full("snmptrap", sink, 0, NULL, sinkport);
if (t != NULL) {
    sesp = snmp_add(&session, t, NULL, NULL);

    if (sesp) {
        return add_trap_session(sesp, pdutype,
                                (pdutype == SNMP_MSG_INFORM), version);
    }
}
...................................................................................
...................................................................................

}

The socket re created every time in ' netsnmp_tdomain_transport_full' call
for the same destination and never getting release resulting in resource
leak and further choking snmp at select call in main():snmpd.c

Why we are not releasing the socket created after sending the trap to
manager or using the same Sessions object (which contain the socket info)
for the same destination?

-Vishal

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.