In certain situations the Linux kernel will give the same interface a different
index number. The agent curently tries to correlate indexes to interface name,
thus gets confused.
To reproduce, pick an interface and figure out what kernel module it uses. Then
: ifdown ethX; rmmod modX; modprobe modX; ifup ethX
You will note that the interface entry in /proc/net/dev is moved to the last
line (if it wasn't already) and all stats are re-set.
For interfaces with physical addresses, we can use the physical address to
correlate a new index to an old index. The ifCounterDiscontinuityTime would be
set, a tweak for handling the HC stats, and everything would be fine.
If the interface name changes to a new name, that's easy as well. Mostly. We
add the new interface and remove the old, right? What if the change is
reverted? The right thing to do would seem to be to restore the old
entry/index.
But how hard should we try to handle the weird cases? For example, the MAC
address changes, but the interface name does not. I would argue that the same
ifIndex should be maintained, and the ifDescr/ifName changed. ifAlias would
remain the same.
Things get really messy, however, when we get to 'interfaces' that do not have
physical addresses. On linux that includes some (all?) ipsec tunnels and VLAN
interfaces. How do we try and correlate these? I'm guessing we're stuck with
interface name, and we'll just have to let the users deal with the mess if an
interface up/down re-uses an interface name for what is really a different
connection/interface.
Just thought I'd solicit some opinions before I dive into the code again...
--
NOTE: messages sent directly to me, instead of the lists, will be deleted
unless they are requests for paid consulting services.
Robert Story; NET-SNMP Junkie
Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders>
You are lost in a twisty maze of little standards, all different.
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders