From owner-svn-src-all@FreeBSD.ORG Sat Oct 6 07:06:58 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 4DD521065673; Sat, 6 Oct 2012 07:06:58 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 38ABD8FC0C; Sat, 6 Oct 2012 07:06:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9676wuv017274; Sat, 6 Oct 2012 07:06:58 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9676wpo017272; Sat, 6 Oct 2012 07:06:58 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201210060706.q9676wpo017272@svn.freebsd.org> From: Gleb Smirnoff Date: Sat, 6 Oct 2012 07:06:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r241244 - head/sys/netpfil/pf X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Oct 2012 07:06:58 -0000 Author: glebius Date: Sat Oct 6 07:06:57 2012 New Revision: 241244 URL: http://svn.freebsd.org/changeset/base/241244 Log: The pfil(9) layer guarantees us presence of the protocol header, so remove extra check, that is always false. P.S. Also, goto there lead to unlocking a not locked rwlock. Modified: head/sys/netpfil/pf/pf.c Modified: head/sys/netpfil/pf/pf.c ============================================================================== --- head/sys/netpfil/pf/pf.c Sat Oct 6 06:07:33 2012 (r241243) +++ head/sys/netpfil/pf/pf.c Sat Oct 6 07:06:57 2012 (r241244) @@ -5620,13 +5620,6 @@ pf_test(int dir, struct ifnet *ifp, stru if (m->m_flags & M_SKIP_FIREWALL) return (PF_PASS); - if (m->m_pkthdr.len < (int)sizeof(struct ip)) { - action = PF_DROP; - REASON_SET(&reason, PFRES_SHORT); - log = 1; - goto done; - } - pd.pf_mtag = pf_find_mtag(m); PF_RULES_RLOCK(); @@ -5992,13 +5985,6 @@ pf_test6(int dir, struct ifnet *ifp, str if (kif->pfik_flags & PFI_IFLAG_SKIP) return (PF_PASS); - if (m->m_pkthdr.len < (int)sizeof(*h)) { - action = PF_DROP; - REASON_SET(&reason, PFRES_SHORT); - log = 1; - goto done; - } - PF_RULES_RLOCK(); /* We do IP header normalization and packet reassembly here */