This bug demonstrates a really nasty problem, with a server that has 
been through many network reconfiguration so that the kernels ifindex 
now has reached 37875 ... which never can fit into the statement

>     return (HRDEV_NETWORK << HRDEV_TYPE_SHIFT) + HRN_index;

(found at line 243 of agent/mibgroup/host/hr_network.c (V5-7-patches)

HRDEV_TYPE_SHIFT is only 8, so when ifindex reaches 256 things go 
astray, and there is no checks in place to detect this.

The current crash of snmpd is because HRN_index is a signed short, and 
the current ifindex value will now turn this into a negative value :-(

The server in question has only 8 active network interfaces, but 
experimentations with network setup (subinterfaces, vlans) makes the 
ifindex grow when interfaces are removed and re-created

This problem is present in all versions from 5.4 and on.

I am not sure of the proper solution for this. In all circumstances I 
think that 255 is a too low limit on network interfaces, and I think 
that we maybe also should do something to reuse ifindex values if a 
network interface to deleted and later recreated, which I don't think 
the kernel will do.

Does this warrant a fix for all the current pre and rc releases?

/Niels

-- 
Niels Baggesen - @home - Ã…rhus - Denmark - n...@users.sourceforge.net
The purpose of computing is insight, not numbers   ---   R W Hamming

------------------------------------------------------------------------------
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

Reply via email to