From: Florian Forster Date: Fri, 25 Nov 2011 09:48:22 +0000 (+0100) Subject: Merge "Fix file:// not working as return code is 0 and not 200, as fixed beforehand... X-Git-Tag: collectd-4.10.5~13 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=d17101b05797e7437814a674c2ed23b6f2f15511;hp=7f88689783624f3555b714d6489c5f0ca4ab7e86;p=collectd.git Merge "Fix file:// not working as return code is 0 and not 200, as fixed beforehand in curl_json. Remove mention of http in documention as file also works now (and ftp most likely too)" into collectd-4.10 --- diff --git a/src/interface.c b/src/interface.c index 1ba6c8c3..9aae5aef 100644 --- a/src/interface.c +++ b/src/interface.c @@ -141,11 +141,17 @@ static int interface_init (void) { 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" */ + 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; }