Hi, We debugged the unregister code and found that registration handler is freed before preparing and sending the unregister pdu to snmpd. We modified unregister_mib_context() function in agent/agent_registry.c to move the function call netsnmp_subtree_free() after snmp_call_callbacks(). After this change, unregistrations and registrations worked fine. We could see that subagent worked fine without any crash. So, is this the proper fix..? Please let us know how can we submit this fix as a patch..?
Regards, Suresh. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kurapati M-G19456 Sent: Thursday, December 01, 2005 7:44 PM To: Net SNMP Subject: Unregister is not working in NET-SNMP-5.2.2. All, We are using NET-SNMP-5.2.2.rc6. When the SubAgent unregisters the OID with the Agent using unregister_mib_context() API. Though a valid OID is given as input to this function, we are seeing SubAgent sending JUNK oids to the Agent for unregister. Has this behavior been observed by anybody? Please help us. Following is the log at the SubAgent. Thanks Mahesh trace: unregister_mib_context(): agent_registry.c, 947: register_mib: unregistering SNMPv2-SMI::enterprises.161.10.3.1.1.12.10.1.1 trace: netsnmp_subtree_find_first(): agent_registry.c, 156: subtree: looking for subtree for context: "" trace: netsnmp_subtree_find_first(): agent_registry.c, 160: subtree: found one for: "" trace: netsnmp_subtree_unload(): agent_registry.c, 861: register_mib: unload(SNMPv2-SMI::enterprises.161.10.3.1.1.12.10.1.1, [NIL]) trace: snmp_call_callbacks(): callback.c, 205: callback: START calling callbacks for maj=1 min=2 trace: snmp_call_callbacks(): callback.c, 219: callback: calling a callback for maj=1 min=2 trace: agentx_unregister(): mibgroup/agentx/client.c, 251: agentx/subagent: unregistering: .135098232.3.6.1.4.1.161.10.3.1.1.12.10.1.1 trace: agentx_realloc_build_header(): mibgroup/agentx/protocol.c, 611: dumph_send: AgentX Header dumpx_send: 01 04 00 00 dumpv_send: Version: 1 trace: agentx_realloc_build_header(): mibgroup/agentx/protocol.c, 614: dumpv_send: Command: 4 (Unregister) trace: agentx_realloc_build_header(): mibgroup/agentx/protocol.c, 617: dumpv_send: Flags: 00 trace: agentx_realloc_build_header(): mibgroup/agentx/protocol.c, 620: dumph_send: Session ID dumpx_send: 0D 00 00 00 dumpv_send: Integer: 13 (0x0D) trace: agentx_realloc_build_header(): mibgroup/agentx/protocol.c, 629: dumph_send: Transaction ID dumpx_send: 00 00 00 00 dumpv_send: Integer: 0 (0x00) trace: agentx_realloc_build_header(): mibgroup/agentx/protocol.c, 638: dumph_send: Request ID dumpx_send: B6 24 A7 25 dumpv_send: Integer: 631710902 (0x25A724B6) trace: agentx_realloc_build_header(): mibgroup/agentx/protocol.c, 647: dumph_send: Dummy Length :-( dumpx_send: 00 00 00 00 dumpv_send: Integer: 0 (0x00) trace: _agentx_realloc_build(): mibgroup/agentx/protocol.c, 714: dumph_send: AgentX Payload trace: _agentx_realloc_build(): mibgroup/agentx/protocol.c, 804: dumph_send: (Un)Register Header dumpx_send: 00 7F 00 00 dumpv_send: Priority: 127 trace: _agentx_realloc_build(): mibgroup/agentx/protocol.c, 813: dumpv_send: Range SubID: 0 dumpv_send: Range SubID: 0 trace: _agentx_realloc_build(): mibgroup/agentx/protocol.c, 820: dumph_send: (Un)Register Prefix trace: agentx_realloc_build_oid(): mibgroup/agentx/protocol.c, 228: dumpv_send: OID: .4294967295.4294967295.0.0.4294967295.0.0.0.0.0.0.0.0.0.0 trace: agentx_realloc_build_oid(): mibgroup/agentx/protocol.c, 263: dumph_send: OID Header dumpx_send: 0F 00 00 00 dumpv_send: # subids: 15 (0x0F) trace: agentx_realloc_build_oid(): mibgroup/agentx/protocol.c, 267: dumpv_send: prefix: 0 (0x00) trace: agentx_realloc_build_oid(): mibgroup/agentx/protocol.c, 269: dumpv_send: inclusive: 0 (0x00) trace: agentx_realloc_build_oid(): mibgroup/agentx/protocol.c, 273: dumph_send: OID Segments dumpx_send: FF FF FF FF dumpv_send: Integer: 4294967295 (0xFFFFFFFF) dumpx_send: FF FF FF FF dumpv_send: Integer: 4294967295 (0xFFFFFFFF) dumpx_send: 00 00 00 00 dumpv_send: Integer: 0 (0x00) dumpx_send: 00 00 00 00 dumpv_send: Integer: 0 (0x00) dumpx_send: FF FF FF FF dumpv_send: Integer: 4294967295 (0xFFFFFFFF) dumpx_send: 00 00 00 00 dumpv_send: Integer: 0 (0x00) dumpx_send: 00 00 00 00 dumpv_send: Integer: 0 (0x00) dumpx_send: 00 00 00 00 dumpv_send: Integer: 0 (0x00) dumpx_send: 00 00 00 00 dumpv_send: Integer: 0 (0x00) dumpx_send: 00 00 00 00 dumpv_send: Integer: 0 (0x00) dumpx_send: 00 00 00 00 dumpv_send: Integer: 0 (0x00) dumpx_send: 00 00 00 00 dumpv_send: Integer: 0 (0x00) dumpx_send: 00 00 00 00 dumpv_send: Integer: 0 (0x00) dumpx_send: 00 00 00 00 dumpv_send: Integer: 0 (0x00) dumpx_send: 00 00 00 00 dumpv_send: Integer: 0 (0x00) dumpx_send:44 00 00 00 dumpv_send: Integer: 68 (0x44) trace: _agentx_realloc_build(): mibgroup/agentx/protocol.c, 1004: agentx_build: packet built okay trace: snmp_sess_select_info(): snmp_api.c, 5771: sess_select: for all sessions: 47 46 (to in 1133285460.141275 sec) 44 sess_select: next alarm 10.449056 sec verbose:sess_select: timer due in 0.999871 sec verbose:sess_select: setting timer to 0.999871 sec, clear block (was 1) trace: _sess_read(): snmp_api.c, 5359: sess_read: not reading 47 (fdset 0x4138c660 set 0) trace: netsnmp_tcp_recv(): snmpTCPDomain.c, 100: ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_idv37&alloc_id865&op=ick _______________________________________________ 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 ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_idv37&alloc_id865&op=click _______________________________________________ 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
