author | Florian Forster <octo@collectd.org> | |
Thu, 24 Nov 2011 14:43:21 +0000 (15:43 +0100) | ||
committer | Gerrit Code Review <gerrit2@huhu.verplant.org> | |
Thu, 24 Nov 2011 14:43:21 +0000 (15:43 +0100) |
src/interface.c | patch | blob | history |
diff --git a/src/interface.c b/src/interface.c
index 1ba6c8c32b73199823134d1662d89975065dc1d9..9aae5aef576d22623d986818aa4a5e21d41d2f99 100644 (file)
--- a/src/interface.c
+++ b/src/interface.c
{
if (strncmp (ksp_chain->ks_class, "net", 3))
continue;
+ /* Ignore kstat entry if not the regular statistic set. This
+ * avoids problems with "bogus" interfaces, such as
+ * "wrsmd<num>" */
+ if (strncmp (ksp_chain->ks_name, ksp_chain->ks_module,
+ strlen (ksp_chain->ks_module)) != 0)
+ continue;
if (ksp_chain->ks_type != KSTAT_TYPE_NAMED)
continue;
if (kstat_read (kc, ksp_chain, NULL) == -1)
continue;
- if ((val = get_kstat_value (ksp_chain, "obytes")) == -1LL)
+ if ((val = get_kstat_value (ksp_chain, "ifspeed")) == -1LL)
continue;
ksp[numif++] = ksp_chain;
}