mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-04 12:52:15 +00:00
fix "ipf -Z" reporting rubbish and possibly panic'ing box
MFC after: 4 days
This commit is contained in:
parent
327ecf6872
commit
649a43212c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=157836
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user