Hi Darren,
Thanks for the patch. It works. After applying the patch, running "ipf -Z"
will not cause kernel panic on Solaris 10 :*)~
Yours,
-- Sum
>
> > Hi All,
> >
> > I am testing the latest ipf 4.1.13 and pfil 2.1.9. While testing, I
> > find out that if I run "/sbin/ipf -Z", it will cause a kernel panic,
> > and that behavior is repeactable. Is it just me or other have seen that
> > too? (FYI.. I followed the instructions from colby.edu for the ipf
> > Sol10 upgrade). ipf 4.1.13 works fine otherwise.
>
> Patch below.
>
> Darren
>
> Index: fil.c
> ===================================================================
> RCS file: /devel/CVS/IP-Filter/fil.c,v
> retrieving revision 2.243.2.79
> diff -c -r2.243.2.79 fil.c
> *** fil.c 16 Apr 2006 03:58:03 -0000 2.243.2.79
> --- fil.c 17 Apr 2006 07:44:31 -0000
> ***************
> *** 6265,6271 ****
> int error;
>
> fr_getstat(&fio);
> ! error = copyoutptr(&fio, data, sizeof(fio));
> if (error)
> return EFAULT;
>
> --- 6265,6271 ----
> int error;
>
> fr_getstat(&fio);
> ! error = fr_outobj(data, &fio, IPFOBJ_IPFSTAT);
> if (error)
> return EFAULT;
>
> Index: tools/ipf.c
> ===================================================================
> RCS file: /devel/CVS/IP-Filter/tools/ipf.c,v
> retrieving revision 1.35.2.4
> diff -c -r1.35.2.4 ipf.c
> *** tools/ipf.c 17 Mar 2006 11:48:08 -0000 1.35.2.4
> --- tools/ipf.c 17 Apr 2006 07:48:35 -0000
> ***************
> *** 451,465 ****
>
> void zerostats()
> {
> friostat_t fio;
> ! friostat_t *fiop = &fio;
>
> if (opendevice(ipfname, 1) != -2) {
> ! if (ioctl(fd, SIOCFRZST, &fiop) == -1) {
> perror("ioctl(SIOCFRZST)");
> exit(-1);
> }
> ! showstats(fiop);
> }
>
> }
> --- 451,471 ----
>
> void zerostats()
> {
> + ipfobj_t obj;
> friostat_t 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, &obj) == -1) {
> perror("ioctl(SIOCFRZST)");
> exit(-1);
> }
> ! showstats(&fio);
> }
>
> }
>