diff --git a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c index 42f78cb8f028..10cce5084b05 100644 --- a/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c +++ b/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c @@ -43,6 +43,7 @@ #include #include +#include #include #include #include @@ -279,6 +280,14 @@ disk_OS_get_ATA_disks(void) strlen(found->dev_name)) != 0) continue; + /* + * Avoid false disk devices. For example adw(4) and + * adv(4) - they are not disks! + */ + if (strlen(map->name_key) > strlen(found->dev_name) && + !isdigit(map->name_key[strlen(found->dev_name)])) + continue; + /* First get the entry from the hrDeviceTbl */ entry = map->entry_p; entry->type = OIDX_hrDeviceDiskStorage_c;