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 <gleb...@freebsd.org> > To: bug-follo...@freebsd.org > Cc: a...@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-unsubscr...@freebsd.org" _______________________________________________ freebsd-ipfw@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ipfw To unsubscribe, send any mail to "freebsd-ipfw-unsubscr...@freebsd.org"