From owner-svn-src-stable@freebsd.org Wed Apr 26 02:37:28 2017 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 016E4D50031; Wed, 26 Apr 2017 02:37:28 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D0F9FE54; Wed, 26 Apr 2017 02:37:27 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v3Q2bQx1013874; Wed, 26 Apr 2017 02:37:26 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v3Q2bQVv013871; Wed, 26 Apr 2017 02:37:26 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201704260237.v3Q2bQVv013871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Wed, 26 Apr 2017 02:37:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r317434 - in stable: 10 10/sys/contrib/ipfilter/netinet 11 11/sys/contrib/ipfilter/netinet X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Apr 2017 02:37:28 -0000 Author: cy Date: Wed Apr 26 02:37:25 2017 New Revision: 317434 URL: https://svnweb.freebsd.org/changeset/base/317434 Log: MFC r316810, r316814, r316816, r316991: Keep state incorrectly assumes keep frags. This is counter to the ipfilter man pages. This also currently restricts keep frags to only when keep state is used, which is redundant because keep state currently assumes keep frags. This commit fixes this. To the user this change means that to maintain the current behaviour one must add keep frags to any ipfilter keep state rule (as documented in the man pages). This patch also allows the flexability to specify and use keep frags separate from keep state, as documented in an example in ipf.conf.5, instead of the currently broken behaviour. MFC suggested by: rgrimes Relnotes: yes Modified: stable/10/UPDATING stable/10/sys/contrib/ipfilter/netinet/fil.c stable/10/sys/contrib/ipfilter/netinet/ip_state.c Directory Properties: stable/10/ (props changed) Changes in other areas also in this revision: Modified: stable/11/UPDATING stable/11/sys/contrib/ipfilter/netinet/fil.c stable/11/sys/contrib/ipfilter/netinet/ip_state.c Directory Properties: stable/11/ (props changed) Modified: stable/10/UPDATING ============================================================================== --- stable/10/UPDATING Wed Apr 26 01:08:25 2017 (r317433) +++ stable/10/UPDATING Wed Apr 26 02:37:25 2017 (r317434) @@ -16,6 +16,15 @@ from older versions of FreeBSD, try WITH stable/10, and then rebuild without this option. The bootstrap process from older version of current is a bit fragile. +20170413: + As of r316810 for ipfilter, keep frags is no longer assumed when + keep state is specified in a rule. r316810 aligns ipfilter with + documentation in man pages separating keep frags from keep state. + This allows keep state to specified without forcing keep frags + and allows keep frags to be specified independently of keep state. + To maintain previous behaviour, also specify keep frags with + keep state (as documented in ipf.conf.5). + 20170323: The code that provides support for ZFS .zfs/ directory functionality has been reimplemented. It's not possible now to create a snapshot Modified: stable/10/sys/contrib/ipfilter/netinet/fil.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/fil.c Wed Apr 26 01:08:25 2017 (r317433) +++ stable/10/sys/contrib/ipfilter/netinet/fil.c Wed Apr 26 02:37:25 2017 (r317434) @@ -2752,7 +2752,7 @@ ipf_firewall(fin, passp) * If the rule has "keep frag" and the packet is actually a fragment, * then create a fragment state entry. */ - if ((pass & (FR_KEEPFRAG|FR_KEEPSTATE)) == FR_KEEPFRAG) { + if (pass & FR_KEEPFRAG) { if (fin->fin_flx & FI_FRAG) { if (ipf_frag_new(softc, fin, pass) == -1) { LBUMP(ipf_stats[out].fr_bnfr); Modified: stable/10/sys/contrib/ipfilter/netinet/ip_state.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_state.c Wed Apr 26 01:08:25 2017 (r317433) +++ stable/10/sys/contrib/ipfilter/netinet/ip_state.c Wed Apr 26 02:37:25 2017 (r317434) @@ -3408,7 +3408,8 @@ ipf_state_check(fin, passp) * If this packet is a fragment and the rule says to track fragments, * then create a new fragment cache entry. */ - if ((fin->fin_flx & FI_FRAG) && FR_ISPASS(is->is_pass)) + if (fin->fin_flx & FI_FRAG && FR_ISPASS(is->is_pass) && + is->is_pass & FR_KEEPFRAG) (void) ipf_frag_new(softc, fin, is->is_pass); /*