Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 Apr 2011 21:30:14 GMT
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        freebsd-ipfw@FreeBSD.org
Subject:   kern/156180
Message-ID:  <201104052130.p35LUElF030950@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/156180; it has been noted by GNATS.

From: Gleb Smirnoff <glebius@FreeBSD.org>
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
 
   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--



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