![](https://secure.gravatar.com/avatar/30678a50135d7135855f9bf1d4d26bc4.jpg?s=120&d=mm&r=g)
Hi,
I came across a design flaw in ifAlias.
First of all the flaw:
declare -a INTERFACES=($(ip l|grep mtu|cut -d: -f2|sed s/\ //g)) ... INTERFACE=$(echo ${INTERFACES[$INDEX]}|cut -d@ -f1)
The Interface INDEX is rarely equal to the indexes of the array. Thus getting all interfaces here is useless, we already get the right Interface ID from SNMPd, so the fix is:
#declare -a INTERFACES=($(ip l|grep mtu|cut -d: -f2|sed s/\ //g)) ... #INTERFACE=$(echo ${INTERFACES[$INDEX]}|cut -d@ -f1) INTERFACE=$((ip l | grep "^${ID}: " | cut -d " " -f 2 | sed 's/://g') 2> /dev/null)
This way, even when tap* respawns with a new INDEX it will still be mapped to the right Description and Alias.
A 2nd bug has been spotted in snmpbulkwalk vs snmpwalk; snmpbulkwalk -QOUs [...] ifAlias leaves out some descriptions but snmpwalk does not, needs further investigation for now I just hacked the snmp.inc.php...
Kind Regards,
Daniel Preussker
[ Security Consultant, Network & Protocol Security and Cryptography [ LPI & Novell Certified Linux Engineer and Researcher [ +49 178 600 96 30 [ Daniel@Preussker.Net [ http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x87E736968E490AA1