On Tue, Jul 3, 2012 at 4:48 PM, Niels Baggesen <ni...@baggesen.net> wrote: > Den 02-07-2012 20:22, Bill Fenner skrev: > > >> A related question: isn't it safer to pretend to the compatibility >> functions that a given interface with ifIndex > 16 bits (or 15 bits) >> doesn't exist, rather than returning a potentially-aliased value >> (e.g., pretend I have two interfaces on my system: lo with ifIndex 1, >> and foo1 with ifIndex 65537. The compatibility functions will see two >> interfaces, both with ifIndex = 1.) > > > That is actually how Wes originally described it: > >> Patch #2 is a bit more complex and creates new integer based index API >> for retrieving indexes and then ensure that they're < 2^SHIFT. If >> they're greater than that, they're dropped as invalid indexes and the >> data isn't reported (which is better than a crash). > > > I would also prefer that behaviour
Ah, I was just looking at the patch. In all.diff, we do see skipping of interfaces if (HRN_index > (1 << HRDEV_TYPE_SHIFT)), but I didn't notice the change to use Interface_Scan_NextInt, so I assumed we would still have the aliasing of values >= 65536. I think that Interface_Scan_Next() should return "there are no more interfaces" if it gets a value >= 65536, to protect old-api consumers against aliasing. Bill ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders