#842 Fix clientaddr functionality

closed
nobody
None
5
2014-12-05
2007-08-16
No

Fix clientaddr functionality.

Previously, the clientaddr option in snmp.conf was parsed, but the actual
clientaddr was used to bind(), yet sendmsg() was still called with 0.0.0.0.

This patch alters:
- netsnmp_udp_fmtaddr: include both sides of addr_pair for debugging.
- netsnmp_udp_transport: Set addr_pair->local_addr in the remote && client_socket path.
- netsnmp_udp_transport: Print a debugging error on failure to bind()
- netsnmp_udp_transport: Print out the full client open addr_pair data.

Signed-off-by: Robin H. Johnson robbat2@gentoo.org

Discussion

  • Dave Shield

    Dave Shield - 2007-08-16

    Logged In: YES
    user_id=88893
    Originator: NO

    Thanks for the patch! It has been applied to the 5.2.x, 5.3.x and 5.4.x code branches and the main development tree, and will appear in future releases of the Net-SNMP package.

     
  • Dave Shield

    Dave Shield - 2007-08-16

    Logged In: YES
    user_id=88893
    Originator: NO

    SVN revision 16654

     
  • Tsurutani Naoki

    Tsurutani Naoki - 2008-01-11

    Logged In: YES
    user_id=1978890
    Originator: NO

    After this patch is adopted, the snmpd log filr entries are strange;
    previously, access from localhost is recorded as
    Connection from UDP: [127.0.0.1]:52331
    and after update to 5.3.2,
    Connection from UDP: [0.0.0.0]->[127.0.0.1]:-13205 REFUSED
    The reason refused is the client address is wrong (0.0.0.0) and
    refused by libwrap. After changing "hosts.allow" to allow snmpd
    from any host, "REFUSED" is not recorded and access is granted.
    An another access from other host is recorded as
    Connection from UDP: [0.0.0.0]->[10.226.65.116]:-12046
    The origin and the target addresses are swapped, as I think.
    Is it right ?
    And, the port number recorded is wrong in both case.
    Currently, the address [0.0.0.0] is checked via agent/snmp_agent.c,
    and libwrap refuses this address.
    I expect "[127.0.0.1]->[127.0.0.1]:52331" from localhost
    and "[10.226.65.116]->[10.226.65.120]:xxxx" from the other host.
    Would you fix this problem ?
    I am using snmpd and not using snmptrapd, on FreeBSD.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks