#842 Fix clientaddr functionality


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

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


  • Dave Shield

    Dave Shield - 2007-08-16

    Logged In: YES
    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
    Originator: NO

    SVN revision 16654

  • Tsurutani Naoki

    Tsurutani Naoki - 2008-01-11

    Logged In: YES
    Originator: NO

    After this patch is adopted, the snmpd log filr entries are strange;
    previously, access from localhost is recorded as
    Connection from UDP: []:52331
    and after update to 5.3.2,
    Connection from UDP: []->[]:-13205 REFUSED
    The reason refused is the client address is wrong ( 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: []->[]:-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 [] is checked via agent/snmp_agent.c,
    and libwrap refuses this address.
    I expect "[]->[]:52331" from localhost
    and "[]->[]: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