ipfw: reset tcp

Luigi Rizzo rizzo at icir.org
Thu May 13 01:37:18 PDT 2004

On Thu, May 13, 2004 at 05:31:46PM +0800, Eugene Grosbein wrote:
> Luigi Rizzo wrote:
> > > When a rule 'reset tcp' matches, a kernel generates new TCP packet.
> > > Will it have to go through ipfw list (from the beginning or not)?
> > 
> > ipfw2 uses an mbuf flag to bypass the firewall - I am not sure if i
> > only used it for the keepalives or also for TCP reset packets
> Please check. I suspect it does not enter ipfw itself,

yes it does skip the firewall, see ip_fw2.c:send_pkt() near the

	ip_rtaddr(ip->ip_dst, &sro);
--->    m->m_flags |= M_SKIP_FIREWALL;
        ip_output(m, NULL, &sro, 0, NULL, NULL);

removing the M_SKIP_FIREWALL would let ipfw process the
packet too. HOWEVER: i think it is a bug in the general case
to reprocess internally-generated packet, because you would rely
on a correct ipfw configuration to avoid loops (which might not
be the case).

I have no idea how ipfw1 used to do (and i am not goin to check!)
but i don't think the generated packet did reenter the firewall.


> it is not processed by my natd and bad things happen here.
> Eugene

More information about the freebsd-ipfw mailing list