On Thu, Aug 25, 2005 at 09:27:19AM +0100, Dave Shield wrote:
> On Wed, 2005-08-24 at 22:52 +0200, Magnus Fromreide wrote:
> > If we look at the code then in agentx/master.c there is the line
> > 
> > sess.local_port = AGENTX_PORT;
> > 
> > but if I look at netsnmp_tcp_create_tstring in snmplib/snmpTCPDomain.c then
> > netsnmp_sockaddr_in is called with the third argument 0, neither local nor
> > remote, and in netsnmp_tcp_transport local is used as a flag to determine
> > if it is a server or client connection.
> 
> Good catch.
> This feels like a hold-over from the change to a modular transport
> system, which effectively deprecated the 'local_port' field.   We
> ran into a similar problem with the handling of trap ports - this
> one has obviously slipped through the net.
> 
> 
> I suspect that the easiest fix will be the same approach as for the
> trap problem - have the AgentX master code explicitly append the
> default port to the transport string (assuming there isn't one
> there already, obviously!).
> 
> 
> Comments?

The solution in snmptrapd.c at about line 1133 looks as if it would break if
an IPv6 numeric address, or just a netsnmp address with transport specifier, is
used.

Beyound that I suppose you are correct, but it feels as if this couldn't be
the only places in the agent that are affected by this, even though I can't
find any other places in the source using grep.

What I really would like to be able to do is to intercept the transport
construction when it have decided that it wish to build a FOO transport and
fix up the parameters then if there is a need for it.

On a completley unrelated tangent, how do I make a transport bind to a random
free port? (Yes, the protocol is not specific about what port to use, it just
provides a way for the other side to detect it)

/MF


-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to