On 08/05/07, Makavy, Erez (Erez) wrote:
> I tried adding this line to target.c:get_target_sessoin():
> netsnmp_ds_set_string(NETSNMP_DS_LIBRARY_ID,
> NETSNMP_DS_LIB_CLIENT_ADDR, "localhost:6666");

> I get an error, you can see in the debug logs:
> ----------------------------------------------------

> netsnmp_sockaddr_in: addr 0xbfe7c040, peername "localhost:6666"
> netsnmp_sockaddr_in: port number suffix :6666
> netsnmp_sockaddr_in: hostname (resolved okay)
> netsnmp_sockaddr_in: return { AF_INET, }

> netsnmp_udp: send 165 bytes from 0x8f52d83 to UDP: []:162 on fd 7
> netsnmp_udp: sendto error, rc -1 (errno 22)
> snmpd: send_trap: Failure in sendto (Invalid argument)

That probably makes sense.
I suspect that there may not be a route from the loopback interface
to that IP address. In order to send traffic to that system, you'd have
to use a source address that's on the same network as either the
destination system, or else a suitable gateway.
Using "localhost" as the source won't qualify.


This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
Net-snmp-coders mailing list