Glenn McAllister wrote:
> Version: net-snmp 5.4.2
> We have the requirement that we need to send informs from a specific
> ipv4 address, as we use the source address to do a lot of the routing on
> our device. The device can have multiple ipv4 addresses, and in that
> situation there is typically a separate address intended for management
> traffic. We can get snmpd to bind to that address on port 161 for the
> usual GET, SET, etc. processing via the agentaddress token. Where we
> are having trouble is getting v3 informs sent off that same interface.
> In our setup we use trapsess to configure the targets, and all informs
> are going through snmpd (either snmpd is sending its own informs, or
> informs are originating from AgentX subagents).
> My apologies in advance if any of the example output or config files
> wrap badly.
> A sample configuration file (mildly obfuscated) looks like:
> rwuser userblah
> agentaddress localhost:161,
> clientaddr
> trapsess -v 3 -u userblah -l authNoPriv -A somepassword -a MD5 -Ci
> trapsess -v 3 -u userblah -l authNoPriv -A somepassword -a MD5 -Ci

So I've made some progress on figuring out what the problem is. The udp
sockets created for the trapsess directives happens in
snmpUDPDomain.c:netsnmp_udp_transport(). If I'm reading things
correctly, there is a lookup on the clientaddr value at line 668, which
would set the source address correctly.

Heres the problem. The snmpd.conf file is being processed before
snmp.conf. Since snmp.conf hasn't been read yet, the value for
clientaddr is NULL when we are processing the trapsess directives,
resulting in the socket binding to INADDR_ANY.

The "obvious" solution is to arrange to have snmp.conf to be processed
before snmpd.conf. Unfortunately, I'm having a hell of a time figuring
out how the config types are registered, and when. I'll keep poking
away, but a pointer would be highly appreciated at this point. :-)

Glenn McAllister +1 416 348 1594
SOMA Networks, Inc. +1 416 977 1414

This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
Net-snmp-users mailing list
Please see the following page to unsubscribe or change other options: