diff options
author | darrenr <darrenr@FreeBSD.org> | 2006-04-18 13:24:14 +0000 |
---|---|---|
committer | darrenr <darrenr@FreeBSD.org> | 2006-04-18 13:24:14 +0000 |
commit | a3ec5442cc70f57d7aa6232d37a55acf640173dd (patch) | |
tree | 41dcbe944948c8d24a28dfa33343be7085428d50 | |
parent | cf16df537c5c462e96af12c15c951da1fe36adce (diff) | |
download | FreeBSD-src-a3ec5442cc70f57d7aa6232d37a55acf640173dd.zip FreeBSD-src-a3ec5442cc70f57d7aa6232d37a55acf640173dd.tar.gz |
fix "ipf -Z" reporting rubbish and possibly panic'ing box
MFC after: 4 days
-rw-r--r-- | contrib/ipfilter/tools/ipf.c | 12 | ||||
-rw-r--r-- | sys/contrib/ipfilter/netinet/fil.c | 2 |
2 files changed, 10 insertions, 4 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); } } diff --git a/sys/contrib/ipfilter/netinet/fil.c b/sys/contrib/ipfilter/netinet/fil.c index 703ff76..a13441c 100644 --- a/sys/contrib/ipfilter/netinet/fil.c +++ b/sys/contrib/ipfilter/netinet/fil.c @@ -6286,7 +6286,7 @@ caddr_t data; int error; fr_getstat(&fio); - error = copyoutptr(&fio, data, sizeof(fio)); + error = fr_outobj(data, &fio, IPFOBJ_IPFSTAT); if (error) return EFAULT; |