diff options
author | 2009-06-25 15:53:12 +0000 | |
---|---|---|
committer | 2009-06-25 15:53:12 +0000 | |
commit | 77e759e92832553f3ab312c401c703fc3608103f (patch) | |
tree | 9d1405b67b6c3bd0ba285b995341aa39d9cb2437 | |
parent | backout the buf_acquire() does the bremfree() since all callers (diff) | |
download | wireguard-openbsd-77e759e92832553f3ab312c401c703fc3608103f.tar.xz wireguard-openbsd-77e759e92832553f3ab312c401c703fc3608103f.zip |
Check RTM_VERSION even on sysctl data.
Tested and OK sthen@, OK henning@
-rw-r--r-- | usr.bin/systat/if.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/systat/if.c b/usr.bin/systat/if.c index 4a855671113..90d6cd12468 100644 --- a/usr.bin/systat/if.c +++ b/usr.bin/systat/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.13 2009/04/03 20:29:21 deraadt Exp $ */ +/* $OpenBSD: if.c,v 1.14 2009/06/25 15:53:12 claudio Exp $ */ /* * Copyright (c) 2004 Markus Friedl <markus@openbsd.org> * @@ -221,8 +221,9 @@ fetchifstat(void) lim = buf + need; for (next = buf; next < lim; next += ifm.ifm_msglen) { bcopy(next, &ifm, sizeof ifm); - if (ifm.ifm_type != RTM_IFINFO || - !(ifm.ifm_addrs & RTA_IFP)) + if (ifm.ifm_version != RTM_VERSION || + ifm.ifm_type != RTM_IFINFO || + !(ifm.ifm_addrs & RTA_IFP)) continue; if (ifm.ifm_index >= nifs) { if ((newstats = realloc(ifstats, (ifm.ifm_index + 4) |