When snmpd is configured to send traps, it is supposed to use the clientaddr
from snmp.conf..

    clientaddr [<transport-specifier>:]<transport-address>
              specifies the source address to be used by command-line applica‐
              tions when sending SNMP requests. See snmpcmd(1) for more infor‐
              mation about the format of addresses.

              This value is also used by snmpd when generating notifications.

It does work for snmptrap from command line but not from snmpd (the value is 
ignored).
I believe the problem is caused because of:
 agent_trap.c:create_trap_session2 uses

    /*
     * if the sink is localhost, bind to localhost, to reduce open ports.
     */
    if ((NULL == netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
                                       NETSNMP_DS_LIB_CLIENT_ADDR)) && 
        ((0 == strcmp("localhost",sink)) || (0 == strcmp("127.0.0.1",sink))))
        session.localname = strdup("localhost");

    t = netsnmp_tdomain_transport_full("snmptrap", sink, 0, NULL, sinkport);

rather than:
    netsnmp_transport_open_client("snmptrap", session.peername)


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to