The interface MIB is restricted at present to 10/100/1000 Mbit
ethernet interfaces on Linux. Ethtool now supports 10G and other speeds.
The convention is to check only for 0 and -1 as "unknown speeds"

diff --git a/agent/mibgroup/if-mib/data_access/interface_linux.c 
b/agent/mibgroup/if-mib/data_access/interface_linux.c
index 245fa99..b3147d4 100644
--- a/agent/mibgroup/if-mib/data_access/interface_linux.c
+++ b/agent/mibgroup/if-mib/data_access/interface_linux.c
@@ -739,19 +739,12 @@ netsnmp_linux_interface_get_if_speed(int fd, const char 
*name)
     strncpy(ifr.ifr_name, name, sizeof(ifr.ifr_name)-1);
     ifr.ifr_data = (char *) &edata;
     
-    if (ioctl(fd, SIOCETHTOOL, &ifr) == -1) {
+    if (ioctl(fd, SIOCETHTOOL, &ifr) == -1 
+       || edata.speed == 0 || edata.speed == -1) {
         DEBUGMSGTL(("mibII/interfaces", "ETHTOOL_GSET on %s failed\n",
                     ifr.ifr_name));
         return netsnmp_linux_interface_get_if_speed_mii(fd,name);
     }
-    
-    if (edata.speed != SPEED_10 && edata.speed != SPEED_100 &&
-        edata.speed != SPEED_1000) {
-        DEBUGMSGTL(("mibII/interfaces", "fallback to mii for %s\n",
-                    ifr.ifr_name));
-        /* try MII */
-        return netsnmp_linux_interface_get_if_speed_mii(fd,name);
-    }
 
     /* return in bps */
     DEBUGMSGTL(("mibII/interfaces", "ETHTOOL_GSET on %s speed = %d\n",

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to