First, a picture:

                    10.1.1.0/24
               ---------------------
                |                 | eth0
manager ---- router1           router2
                |                 | eth1
               ---------------------
                    10.2.2.0/24

The manager is singly-homed, with the address 10.3.3.3.  It sends a
request to router2's 10.1.1.2 address, so the request comes in eth0.
router2's routing table points 10.3.3.0/24 to eth1, however -- the
next hop is 10.2.2.1, router1's address.

IP normally works fine in this situation, of course, and Net-SNMP 5.5
works as well -- manager can talk to router2 just fine.

It stopped working in Net-SNMP 5.6, due to the use of the interface
index in IP_PKTINFO.  Specifying the interface index causes Linux to
try to send the packet out eth0, so it just ARPs for it -- but since
the destination is not on the local network, the ARPs don't get
replied to.  This means that router2 cannot reply to requests from
manager that are sent to its eth0.

This use of the interface index was introduced in r17855, a little
over a year ago:

Modified Tue Dec 1 07:34:43 2009 UTC (12 months, 1 week ago) by jsafranek

   CHANGES: snmplib: Fix responding to broadcast requests.
   UDP responses are sent with source IP address which was destination of
   appropriate requests (implemented in SVN rev. 15215). But if the destination
   of a request is broadcast IP address, the request was sent with the
broadcast
   address as source. sendmsg() on Linux does not support this and returns error
   -> response is not sent. In order to send responses from the same interface,
   interface index of the appropriate interface must be used.


I'm not sure what to suggest as a solution.  For those who use
net-snmp as the agent on a router, where asymmetric routing like this
is very common, this black hole for the responses is a real problem.

I think a better solution for responding to broadcast requests is to
not use the if_index, and just don't specify the source address when
the request was to a broadcast address.  (In fact, the current
solution won't work for directed broadcasts, e.g., in the above
picture, if router1 allows manager to send a directed broadcast to the
top network -- neither router will be able to reply.)  Unfortunately,
this means having to figure out if a given address is a broadcast, you
have to get a list of interfaces on the system.  Obviously, the
ipAddrTable has this info, but that's not available to snmplib
(especially if, like us, you have your own IP-MIB implementation).

Any other ideas?

Thanks,
  Bill

------------------------------------------------------------------------------
Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
new data types, scalar functions, improved concurrency, built-in packages, 
OCI, SQL*Plus, data movement tools, best practices and more.
http://p.sf.net/sfu/oracle-sfdev2dev 
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to