Hi, Coders. I've investigated the use of f_fmtaddr functions
that each transport provides, and discovered several memory leaks
in 5.1.2 and in the main branch.
Please review bug [ 1040429 ] memory leaked past f_fmtaddr calls
We know that the IPv6 related transports are not currently working
properly. I've studied a few of the solutions that were offered,
and discovered that making the formatted addresses consistent
leads to a simpler approach to handling the addresses.
Please review bug [ 1040431 ] transport addrs not consistent
I would suggest that these changes provide good benefit
and represent low risk.
The patches are best when 1040429 is applied first
The tcp wrappers functionality is broken for IPv6.
The TCP and UDP transport *name*, along with the port, are
not included in any log describing a connection.
Ran a source audit, and discovered several things:
1. The formatted address rendered by the transport
is consistent for AAL5PVC, IPX, Callback, always
beginning with :
a) Name of Transport, capitalized
b) ": "
c) the formatted address as such.
2. The formatted address is passed unparsed to the
TCP wrappers' "host_ctl()" call. This will work
only for UDP and TCP.
3. UDP and TCP transports encode only the address
into the formatted address. The bound port is
not included.
4. TCP/IPv6 and UDP/IPv6 wrap the address in braces,
but the "hosts_ctl()" method can't decipher them.
Proposal:
A. Prefix transport name, colon, space, brace-encapsulated
address, colon, postfix port number to
formatted addresses for TCP and UDP.
B. Prefix transport name, colon, space, to TCP/IPv6 and
UDP/IPv6 formatted addresses.
C. If a formatted address does not contain a "[", ignore
the TCP wrapper test and accept the connection.
Very appropriate for IPX, AAL5PVPC, Callback transports.
D. Strip braces from addresses before invoking host_ctl.
Advantages:
All formatted addresses will identify the transport and the port number;
Example log output noting connection succeeded:
Connection from UDP: [127.0.0.1]:32806
Caveats:
Since the f_fmtaddr function is called frequently by the agent,
that function should be refactored to provide the address only
component for the purpose of expediting the TCP wrapper test call.
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Net-snmp-coders mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders