IPfilter
[Top] [All Lists]

Re: ipfstat not clearing the state table - a similar problem?

To: "Simon A. Boggis" <s.a.boggis@qmul.ac.uk>
Subject: Re: ipfstat not clearing the state table - a similar problem?
From: Darren Reed <darrenr@reed.wattle.id.au>
Date: Thu, 14 Dec 2006 11:23:55 +1100
Cc: ipfilter@coombs.anu.edu.au
Delivered-to: sp-com-lists@consult.net
Delivered-to: ipfilter-list@securepoint.com
In-reply-to: <45808871.2010603@qmul.ac.uk>
References: <200608141903.k7EJ3AIa000853@firewall.reed.wattle.id.au> <EC6E553A-F2B3-429E-A5FC-77A53A7432FC@uia.net> <45781EDE.4080205@qmul.ac.uk> <457A1078.6090901@reed.wattle.id.au> <e2e114e10612110302r1df24c33n1470d4c8b29a200f@mail.gmail.com> <457D59B3.6090505@reed.wattle.id.au> <457DFF26.10308@qmul.ac.uk> <457E048A.1000503@qmul.ac.uk> <e2e114e10612112004t645b1e29kaad3448d8da6b28b@mail.gmail.com> <457E7B89.5010906@reed.wattle.id.au> <45808871.2010603@qmul.ac.uk>
Reply-to: darrenr@reed.wattle.id.au
Sender: owner-ipfilter@coombs.anu.edu.au
User-agent: Thunderbird 1.5.0.5 (Windows/20060719)
Simon A. Boggis wrote:
> Darren Reed wrote:
>   
>> Corey Johnston wrote:
>>     
>>> Yeah, I'm having problems with that line too.
>>> Looks safe to me to change ISL_UNLOAD to 0.
>>>       
>> For some reason ip_state.h must have escaped being in the diff.
>>
>> Using 0 will work better for you than what the actual one would :)
>>
>> Darren
>>
>>     
>
> There's a problem with the patch - I've patched and rebuilt a test
> system before trying it on my live one, unfortunately:
>
>    ipfstat -sl
>
> now dumps core:
>
> # cd /usr/src/ipfilter/ip_fil4.1.13_with_QM_patches_plus_Darrens_orph.patch
> # gdb BSD/FreeBSD-5.4-RELEASE-p22-i386/ipfstat /root/ipfstat.core
> GNU gdb 6.1.1 [FreeBSD]
> Copyright 2004 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain
> conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for details.
> This GDB was configured as "i386-marcel-freebsd"...
> Core was generated by `ipfstat'.
> Program terminated with signal 10, Bus error.
> Reading symbols from /lib/libncurses.so.5...done.
> Loaded symbols for /lib/libncurses.so.5
> Reading symbols from /lib/libkvm.so.2...done.
> Loaded symbols for /lib/libkvm.so.2
> Reading symbols from /lib/libc.so.5...done.
> Loaded symbols for /lib/libc.so.5
> Reading symbols from /libexec/ld-elf.so.1...done.
> Loaded symbols for /libexec/ld-elf.so.1
> #0  printstate (sp=0xc379c000, opts=262176, now=443)
>     at ../../lib/printstate.c:24
> 24             if (sp->is_phnext == NULL)
> (gdb) bt
> #0  printstate (sp=0xc379c000, opts=262176, now=443)
>     at ../../lib/printstate.c:24
> #1  0x0804abb4 in showipstates (ipsp=0xbfbfeafc) at
> ./../tools/ipfstat.c:983
> #2  0x08049b26 in main (argc=2, argv=0xbfbfeaf4) at
> ./../tools/ipfstat.c:376
> (gdb) frame 0
> #0  printstate (sp=0xc379c000, opts=262176, now=443)
>     at ../../lib/printstate.c:24
> 24             if (sp->is_phnext == NULL)
> (gdb) print sp
> $1 = (ipstate_t *) 0xc379c000
> (gdb) print *sp
> Cannot access memory at address 0xc379c000
> (gdb) list
> 19              synclist_t ipsync;
> 20
> 21              if (kmemcpy((char *)&ips, (u_long)sp, sizeof(ips)))
> 22                      return NULL;
> 23
> 24             if (sp->is_phnext == NULL)
> 25                     PRINTF("ORPHAN ");
> 26              PRINTF("%s -> ", hostname(ips.is_v, &ips.is_src.in4));
> 27              PRINTF("%s pass %#x pr %d state %d/%d bkt %d\n",
> 28                      hostname(ips.is_v, &ips.is_dst.in4)
>   

he he he....change line 24 to be:

if (ips.is_phnext == NULL)

I don't know how this works for me on NetBSD but it does.

Darren


<Prev in Thread] Current Thread [Next in Thread>