tech-net archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Patch to implement SIOCGIFINDEX



On 2/04/2013, at 12:29 PM, christos%astron.com@localhost (Christos Zoulas) 
wrote:

> I would only implement it for the emulation, because it suffers from TOCTOU.

Are you thinking of the fact that index numbers are reused as interfaces come 
and go, or do you have something more concrete in mind?

The consumer of interfaces numbers that I have worked with most is SNMP and 
unfortunately it's been a little while since I was up to my neck in this sort 
of thing. IIRC SNMP allows the index numbers to change and doesn't promise 
consistency from one query to the next, so this isn't a problem that needs to 
be fixed for the most common usage. Good documentation should sort out any 
remaining issues.

Another issue with SNMP is that by using the AgentX protocol, it is possible to 
loosely couple SNMP agent components leading to the problem where it isn't 
clear how the components should agree on how to number the interfaces. Using 
the kernel's own interface indexes provides an easy solution to that problem. 
Knowing when those index numbers change (because interfaces have been created 
or destroyed) would be useful, but maybe this information is sent on the 
routing socket? I've never had a use for the routing socket, so I don't know 
exactly what can be learned from it.

Cheers,
Lloyd



Home | Main Index | Thread Index | Old Index