Running net-snmp 5.7.3.pre1 on Darwin13, with a simple "snmpwalk <agent>", a given row is returned twice:
IP-FORWARD-MIB::ipCidrRouteDest.127.0.0.0.255.0.0.0.0.127.0.0.1 = IpAddress: 127.0.0.0 IP-FORWARD-MIB::ipCidrRouteDest.127.0.0.1.0.0.0.0.0.127.0.0.1 = IpAddress: 127.0.0.1 IP-FORWARD-MIB::ipCidrRouteDest.134.170.24.161.0.0.0.0.0.192.168.1.1 = IpAddress: 134.170.24.161 IP-FORWARD-MIB::ipCidrRouteDest.147.28.0.35.0.0.0.0.0.192.168.1.1 = IpAddress: 147.28.0.35 IP-FORWARD-MIB::ipCidrRouteDest.157.55.56.140.0.0.0.0.0.192.168.1.1 = IpAddress: 157.55.56.140 IP-FORWARD-MIB::ipCidrRouteDest.162.210.130.3.0.0.0.0.0.192.168.1.1 = IpAddress: 162.210.130.3 IP-FORWARD-MIB::ipCidrRouteDest.162.210.130.3.0.0.0.0.0.192.168.1.1 = IpAddress: 162.210.130.3 Error: OID not increasing: IP-FORWARD-MIB::ipCidrRouteDest.162.210.130.3.0.0.0.0.0.192.168.1.1 >= IP-FORWARD-MIB::ipCidrRouteDest.162.210.130.3.0.0.0.0.0.192.168.1.1
Frustratingly, this is only sometimes repeatable. It is the same oid when it does happen, but after restarting the agent with -DALL I was not able to repeat this.
Does it happen with inetCidrRouteTable too (yes, I noticed it was not consistent)?
What does your actual routing table look like?
Yup, it happens with inetCidrRouteTable too. I just tried again with the top of the V5-7-patches branch.
and a different spot in the ipCidrRoute table:
I see at least a couple of problems with the ipCidrRoute data:
0.0.0.0 and other nonsensical netmasks (128.0.5.4?)
also bogus nexthops, e.g., 6.0.0.0, 6.0.6.0
The route for 192.168.1.4 is actually an ARP entry
One very plausible reason that we're having trouble reading this routing table is that I have two connections to the same subnet - one wired, one wireless (because I'm too lazy to turn off wireless when I plug into the Thunderbolt monitor that has an Ethernet connection). The routing table looks kinda "interesting":
On the inetCidrRouteTable side, there are entries for destinations that are not in my routing table:
but
These extra destinations are destinations that I have TCP connections with, so they appear to be route caches (used to share TCP connection data between multiple TCP connections) - "route get <destination>" shows, e.g.,
I think the more I look at this, the more mysteries there are.
I looked at this a little more based on donatilo mentioning it on
#net-snmp
. The loop returning the same object is almost definitely due to the use ofCONTAINER_KEY_ALLOW_DUPLICATES
. The routing table is the only part of the system that sets this flag. While this allows duplicates to be inserted into the binary container, it doesn't handle them when trying to getnext. Imagine the following container contents:Let's do a getnext of D. Our binary search returns pos 4, cool. Now let's increment the iterator to pos 5 and return that value. Oops, we returned D again!
If
CONTAINER_KEY_ALLOW_DUPLICATES
is set, we need more code (not yet clear to me where) to handle the getnext handling in the face of duplicates.A straightforward resolution would be to stop setting
CONTAINER_KEY_ALLOW_DUPLICATES
, but of course that re-introduces the performance problem that it was trying to solve.