diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2009-06-25 15:53:13 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2009-06-25 15:53:13 +0000 |
commit | e9ac9dbec23f3334c34cbb19029291322d367c96 (patch) | |
tree | 043a17359536071bfe3220b564a76266ead651bc | |
parent | 76b6aacf60d37639f946fe7c18eba405f282e980 (diff) |
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) |