From owner-freebsd-net@FreeBSD.ORG Thu Nov 8 19:43:41 2007 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DF98116A41A for ; Thu, 8 Nov 2007 19:43:41 +0000 (UTC) (envelope-from max@love2party.net) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.174]) by mx1.freebsd.org (Postfix) with ESMTP id 6E8C713C4C6 for ; Thu, 8 Nov 2007 19:43:41 +0000 (UTC) (envelope-from max@love2party.net) Received: from amd64.laiers.local (dslb-088-066-049-089.pools.arcor-ip.net [88.66.49.89]) by mrelayeu.kundenserver.de (node=mrelayeu7) with ESMTP (Nemesis) id 0ML2xA-1IqDHp2t0W-000557; Thu, 08 Nov 2007 20:43:34 +0100 From: Max Laier Organization: FreeBSD To: freebsd-net@freebsd.org Date: Thu, 8 Nov 2007 20:43:22 +0100 User-Agent: KMail/1.9.7 References: <86zlxoblmj.fsf@ds4.des.no> In-Reply-To: <86zlxoblmj.fsf@ds4.des.no> X-Face: ,,8R(x[kmU]tKN@>gtH1yQE4aslGdu+2]; R]*pL,U>^H?)gW@49@wdJ`H<=?utf-8?q?=25=7D*=5FBD=0A=09U=5For=3D=5CmOZf764=26nYj=3DJYbR1PW0ud?=>|!~,,CPC.1-D$FG@0h3#'5"k{V]a~.<=?utf-8?q?mZ=7D44=23Se=7Em=0A=09Fe=7E=5C=5DX5B=5D=5Fxj?=(ykz9QKMw_l0C2AQ]}Ym8)fU MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart4037246.dFbJLhBaAX"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200711082043.31664.max@love2party.net> X-Provags-ID: V01U2FsdGVkX18fB3coJvGiSMlOiMwwiLnGUXAZg2e7dfvbqDI E5EHp9x7GJWXKksWLIw5p5JLTlFYNDP4cJ8a+PbtKY0fObie1G DrsFXKFw6QNuuUWc3PU7cAJvy5M6C1Bmrp6NApPwjo= Cc: Dag-Erling =?iso-8859-1?q?Sm=F8rgrav?= Subject: Re: pf misfeature X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Nov 2007 19:43:42 -0000 --nextPart4037246.dFbJLhBaAX Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Thursday 08 November 2007, Dag-Erling Sm=C3=B8rgrav wrote: > Given appropriate definitions for $eth and $lan, you'd expect the > following rule to simply pass all traffic originating from and destined > for the LAN: > > pass on $eth from $lan to $lan > > However, in pf, "keep state" is *implicit* (why?), so you'd expect it > to turn into something like this: > > pass on $eth from $lan to $lan keep state > > but what you actually get is this: > > pass on $eth from $lan to $lan flags S/SA keep state > > which only matches TCP handshakes, so your UDP streams are screwed. I don't think this is true. It will match any protocol, but if it is tcp=20 it will make sure it's the initial SYN. This is necessary in order to=20 have the state tracking work with window scaling etc. In my quick testing, icmp and udp both match the expanded rule. > Workaround: explicitly specify TCP and UDP, causing pf to split the > rule into two: > > pass on $eth inet proto { tcp, udp } from $lan to $lan > > becomes > > pass on $eth inet proto tcp from $lan to $lan flags S/SA keep state > pass on $eth inet proto udp from $lan to $lan keep state > > There does not seem to be any way to turn off this misguided rewriting > of firewall rules. =2D-=20 /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News --nextPart4037246.dFbJLhBaAX Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (FreeBSD) iD8DBQBHM2bjXyyEoT62BG0RAtPzAJ9LXUs7iBmmOwpu9z0SPVlx9sqGXwCaAreA Xgi5RouXTetQd1Z3z7V6dk4= =C2aX -----END PGP SIGNATURE----- --nextPart4037246.dFbJLhBaAX--