Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 Sep 2003 08:01:42 -0400
From:      "James F.  Hranicky" <jfh@cise.ufl.edu>
To:        Robert Watson <rwatson@FreeBSD.org>
Cc:        freebsd-bugs@FreeBSD.org
Subject:   Re: conf/56031: ipfw hangs on every invocation
Message-ID:  <20030904080142.5121b382.jfh@cise.ufl.edu>
In-Reply-To: <Pine.NEB.3.96L.1030903114400.93404C-100000@fledge.watson.org>
References:  <20030903062809.2ae57891.jfh@cise.ufl.edu> <Pine.NEB.3.96L.1030903114400.93404C-100000@fledge.watson.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 3 Sep 2003 11:45:41 -0400 (EDT)
Robert Watson <rwatson@FreeBSD.org> wrote:

> On Wed, 3 Sep 2003, James F.  Hranicky wrote:

> I'd step up to the ioctl in question, and then see if it really hangs in
> the ioctl(), or if it gets past and starts spinning.  If it's the ioctl(),
> it would be very helpful to know which file descriptor it's on, and what
> the arguments are.  If it's not the ioctl() call, we need to figure out
> which loop isn't taking something important into account.

I think I've found it. First off, I neglected to mention I've added

	IPFW2=TRUE

to /etc/make.conf, so I'm using ipfw2 (sorry!).

After tracing through, it does seem to be a logic error in ipfw2.c .

At line 1036, there a loop like so:

        for (l = rule->act_ofs, cmd = rule->cmd ;
                        l > 0 ; l -= F_LEN(cmd) , cmd += F_LEN(cmd)) {

The loop is supposed to quit when l == 0, and l is supposed to be decremented
by F_LEN(cmd) each time.

F_LEN is defined as

	#define   F_LEN_MASK      0x3f
	#define   F_LEN(cmd)      ((cmd)->len & F_LEN_MASK)

Checking the values of the cmd struct:

	(gdb) p *cmd
	$6 = {opcode = O_NOP, len = 0 '\000', arg1 = 0}

Darn, l is always decremented by 0.

I'll probably fix the problem on my end by temporarily disabling ipfw2 (since I'm
not really even using it at the moment). 

Hope this helps.

Jim



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030904080142.5121b382.jfh>