From owner-freebsd-ipfw@FreeBSD.ORG Wed Apr 6 06:45:26 2011 Return-Path: Delivered-To: freebsd-ipfw@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C944106566C for ; Wed, 6 Apr 2011 06:45:26 +0000 (UTC) (envelope-from luigi@onelab2.iet.unipi.it) Received: from onelab2.iet.unipi.it (onelab2.iet.unipi.it [131.114.59.238]) by mx1.freebsd.org (Postfix) with ESMTP id 5A6328FC14 for ; Wed, 6 Apr 2011 06:45:25 +0000 (UTC) Received: by onelab2.iet.unipi.it (Postfix, from userid 275) id AF3887300A; Wed, 6 Apr 2011 09:00:00 +0200 (CEST) Date: Wed, 6 Apr 2011 09:00:00 +0200 From: Luigi Rizzo To: Gleb Smirnoff Message-ID: <20110406070000.GA8987@onelab2.iet.unipi.it> References: <201104052130.p35LUElF030950@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201104052130.p35LUElF030950@freefall.freebsd.org> User-Agent: Mutt/1.4.2.3i Cc: freebsd-ipfw@freebsd.org Subject: Re: kern/156180 X-BeenThere: freebsd-ipfw@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: IPFW Technical Discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Apr 2011 06:45:26 -0000 On Tue, Apr 05, 2011 at 09:30:14PM +0000, Gleb Smirnoff wrote: > The following reply was made to PR kern/156180; it has been noted by GNATS. > > From: Gleb Smirnoff > To: bug-followup@FreeBSD.org > Cc: ae@FreeBSD.org > Subject: kern/156180 > Date: Wed, 6 Apr 2011 01:07:29 +0400 > > --5gxpn/Q6ypwruk0T > Content-Type: text/plain; charset=koi8-r > Content-Disposition: inline no objection cheers luigi > What about the following approach? See attached > snap, not tested, patch. > > -- > Totus tuus, Glebius. > > --5gxpn/Q6ypwruk0T > Content-Type: text/x-diff; charset=koi8-r > Content-Disposition: attachment; filename="156180.diff" > > Index: ip_fw2.c > =================================================================== > --- ip_fw2.c (revision 220373) > +++ ip_fw2.c (working copy) > @@ -913,9 +913,10 @@ > * pointer might become stale after other pullups (but we never use it > * this way). > */ > -#define PULLUP_TO(_len, p, T) \ > +#define PULLUP_TO(_len, p, T) PULLUP_LEN(_len, p, sizeof(T)) > +#define PULLUP_LEN(_len, p, T) \ > do { \ > - int x = (_len) + sizeof(T); \ > + int x = (_len) + T; \ > if ((m)->m_len < x) { \ > args->m = m = m_pullup(m, x); \ > if (m == NULL) \ > @@ -1600,6 +1601,7 @@ > break; > > case O_TCPOPTS: > + PULLUP_LEN(hlen, ulp, (TCP(ulp)->th_off << 2)); > match = (proto == IPPROTO_TCP && offset == 0 && > tcpopts_match(TCP(ulp), cmd)); > break; > @@ -2230,6 +2232,7 @@ > } > > } /* end of inner loop, scan opcodes */ > +#undef PULLUP_LEN > > if (done) > break; > > --5gxpn/Q6ypwruk0T-- > _______________________________________________ > freebsd-ipfw@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-ipfw > To unsubscribe, send any mail to "freebsd-ipfw-unsubscribe@freebsd.org"