fix "ipf -Z" reporting rubbish and possibly panic'ing box

MFC after:	4 days
This commit is contained in:
Darren Reed 2006-04-18 13:24:14 +00:00
parent 327ecf6872
commit 649a43212c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=157836
2 changed files with 10 additions and 4 deletions

View File

@ -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);
}
}

View File

@ -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;