Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 157851 - Patch (net-snmp-5.1.2-agentx_register_callbacks_entry.patch) causes AgentX inoperability
Summary: Patch (net-snmp-5.1.2-agentx_register_callbacks_entry.patch) causes AgentX in...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: net-snmp
Version: 3
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Radek Vokal
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-05-16 14:17 UTC by W Raul S
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-05-24 06:53:18 UTC


Attachments (Terms of Use)
Double Free Callback Patch (deleted)
2005-05-23 13:04 UTC, W Raul S
no flags Details | Diff

Description W Raul S 2005-05-16 14:17:29 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.7) Gecko/20050416 Fedora/1.0.3-1.3.1 Firefox/1.0.3

Description of problem:
The patch "net-snmp-5.1.2-agentx_register_callbacks_entry.patch" of the srpm of net-snmp incorrectly fixes the "double free" problem and causes another more important problem: sub-agents using the agentx protocol can not register with a master agent through either a unix socket or tcp port. 

The known bug that this said patch aims to fix occurs when the netsnmp_session is free'd by the "snmp_free_session()" call in "net-src-root/snmplib/snmp_api.c" on line 1867 and by "net-src-root/snmplib/callback.c" on line 356. This bug surfaces when the sub-agent shuts down. There is no patch for the problem at the moment.

The new bug is a result of the said patch which creates a copy of the netsnmp_session in "net-src-root/agent/mibgroup/agentx/subagent.c" and sends the copy to be registered through the callback functions, though the subagent uses the original session to send/receive messages to/from the master agent. As a result any mib including the example mibs distributed in the release, do not work as sub-agents. 

Note: This has been tried with both the default unix socket (/var/agentx/master) and tcp sockets with the same behavior. Because of the error when the master agent tried to delete the session, it has an error and does not delete the socket when the master shuts down.

Version-Release number of selected component (if applicable):
net-snmp-5.2.1-10.FC3

How reproducible:
Always

Steps to Reproduce:
1. Compile the srpm net-snmp-5.2.1-10.FC3
2. Install 
3. Run the master agent ( /usr/sbin/snmpd -f -Lo -d )
4. Compile a sub-agent, using the example sub-agent server with an example mib.
5. The error message from the agent will occur twice:   "AgentX master agent failed to respond to ping"

Actual Results:  "AgentX master agent failed to respond to ping"

Expected Results:  There should be no error message, and the mib should be able to be queried by an snmp get/walk/table command as appropiate.

Additional info:

The sub-agent feature of net-snmp is a critical function for embedding snmp mib capabilities into applications.

Comment 1 W Raul S 2005-05-23 13:04:47 UTC
Created attachment 114710 [details]
Double Free Callback Patch

Rober Story (of www.net-snmp.org) created a patch for this bug. I've attached
it here. It should be in the main branch of net-snmp, though i hope this in
time to make the FC4 release.

Raul

Comment 2 Radek Vokal 2005-05-24 06:53:18 UTC
I've just applied a slightly different patch for this issue, it lies in rawhide
- net-snmp-5.2.1-12 but I will compare it to this proposed patch. 

Comment 3 W Raul S 2005-05-24 23:15:27 UTC
Can you provide a link to net-snmp-5.2.1-12 ? It is not on the
download.fedora.redhat.com site. Thanks


Note You need to log in before you can comment on or make changes to this bug.