summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authorfenner <fenner@FreeBSD.org>2001-10-17 04:12:29 +0000
committerfenner <fenner@FreeBSD.org>2001-10-17 04:12:29 +0000
commit1e7fe9f955a3d9d24a8f7545a033f8b90126e3bf (patch)
tree3a092a48e9ca517c0577423fc3e3894299750bb4 /libexec
parentb69c7c0b789e7ca4de555baab2ee087e1bb5d231 (diff)
downloadFreeBSD-src-1e7fe9f955a3d9d24a8f7545a033f8b90126e3bf.zip
FreeBSD-src-1e7fe9f955a3d9d24a8f7545a033f8b90126e3bf.tar.gz
The interface index space may be sparsely populated (e.g. when an
interface in the middle is if_detach()'d). Return (and handle) ENOENT when the ifmib(4) is accessed for a nonexistent interface. MFC after: 14 days
Diffstat (limited to 'libexec')
-rw-r--r--libexec/rpc.rstatd/rstat_proc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libexec/rpc.rstatd/rstat_proc.c b/libexec/rpc.rstatd/rstat_proc.c
index 1014326..2b63394 100644
--- a/libexec/rpc.rstatd/rstat_proc.c
+++ b/libexec/rpc.rstatd/rstat_proc.c
@@ -51,6 +51,7 @@ static const char rcsid[] =
#include <sys/param.h>
#include <err.h>
+#include <errno.h>
#include <fcntl.h>
#include <kvm.h>
#include <limits.h>
@@ -294,6 +295,9 @@ updatestat()
mib[4] = i;
mib[5] = IFDATA_GENERAL;
if (sysctl(mib, 6, &ifmd, &len, 0, 0) < 0) {
+ if (errno == ENOENT)
+ continue;
+
syslog(LOG_ERR, "sysctl(net.link.ifdata.%d.general)"
": %m", i);
exit(1);
OpenPOWER on IntegriCloud