summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authordarrenr <darrenr@FreeBSD.org>2006-04-18 13:24:14 +0000
committerdarrenr <darrenr@FreeBSD.org>2006-04-18 13:24:14 +0000
commita3ec5442cc70f57d7aa6232d37a55acf640173dd (patch)
tree41dcbe944948c8d24a28dfa33343be7085428d50 /contrib
parentcf16df537c5c462e96af12c15c951da1fe36adce (diff)
downloadFreeBSD-src-a3ec5442cc70f57d7aa6232d37a55acf640173dd.zip
FreeBSD-src-a3ec5442cc70f57d7aa6232d37a55acf640173dd.tar.gz
fix "ipf -Z" reporting rubbish and possibly panic'ing box
MFC after: 4 days
Diffstat (limited to 'contrib')
-rw-r--r--contrib/ipfilter/tools/ipf.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/contrib/ipfilter/tools/ipf.c b/contrib/ipfilter/tools/ipf.c
index c59bbed4..53c4c5a 100644
--- a/contrib/ipfilter/tools/ipf.c
+++ b/contrib/ipfilter/tools/ipf.c
@@ -453,15 +453,21 @@ void ipf_frsync()
void zerostats()
{
+ ipfobj_t obj;
friostat_t fio;
- friostat_t *fiop = &fio;
+
+ obj.ipfo_rev = IPFILTER_VERSION;
+ obj.ipfo_type = IPFOBJ_IPFSTAT;
+ obj.ipfo_size = sizeof(fio);
+ obj.ipfo_ptr = &fio;
+ obj.ipfo_offset = 0;
if (opendevice(ipfname, 1) != -2) {
- if (ioctl(fd, SIOCFRZST, &fiop) == -1) {
+ if (ioctl(fd, SIOCFRZST, &obj) == -1) {
perror("ioctl(SIOCFRZST)");
exit(-1);
}
- showstats(fiop);
+ showstats(&fio);
}
}
OpenPOWER on IntegriCloud