From owner-svn-src-stable@freebsd.org Sat Sep 19 03:58:32 2015 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 91977A03B7B; Sat, 19 Sep 2015 03:58:32 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::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 817B41C28; Sat, 19 Sep 2015 03:58:32 +0000 (UTC) (envelope-from cy@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t8J3wWtd067794; Sat, 19 Sep 2015 03:58:32 GMT (envelope-from cy@FreeBSD.org) Received: (from cy@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t8J3wW6Y067793; Sat, 19 Sep 2015 03:58:32 GMT (envelope-from cy@FreeBSD.org) Message-Id: <201509190358.t8J3wW6Y067793@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cy set sender to cy@FreeBSD.org using -f From: Cy Schubert Date: Sat, 19 Sep 2015 03:58:32 +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: r287984 - stable/10/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.20 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: Sat, 19 Sep 2015 03:58:32 -0000 Author: cy Date: Sat Sep 19 03:58:31 2015 New Revision: 287984 URL: https://svnweb.freebsd.org/changeset/base/287984 Log: MFC r287651, r287652, r287653. Fix mutex errors, fixup typos in comments. Obtained from: NetBSD r1.4. -This lie, anr those below, will be ignored-- > Description of fields to fill in above: 76 columns --| > PR: If a GNATS PR is affected by the change. > Submitted by: If someone else sent in the change. > Reviewed by: If someone else reviewed your modification. > Approved by: If you needed approval for this commit. > Obtained from: If the change is from a third party. > MFC after: N [day[s]|week[s]|month[s]]. Request a reminder email. > MFH: Ports tree branch name. Request approval for merge. > Relnotes: Set to 'yes' for mention in release notes. > Security: Vulnerability reference (one per line) or description. > Sponsored by: If the change was sponsored by an organization. > Differential Revision: https://reviews.freebsd.org/D### (*full* phabric URL needed). > Empty fields above will be automatically removed. _M . M sys/contrib/ipfilter/netinet/ip_state.c Modified: stable/10/sys/contrib/ipfilter/netinet/ip_state.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/contrib/ipfilter/netinet/ip_state.c ============================================================================== --- stable/10/sys/contrib/ipfilter/netinet/ip_state.c Sat Sep 19 03:53:37 2015 (r287983) +++ stable/10/sys/contrib/ipfilter/netinet/ip_state.c Sat Sep 19 03:58:31 2015 (r287984) @@ -1,4 +1,4 @@ -/* $FreeBSD$ */ +/* $FreeBSD$ */ /* * Copyright (C) 2012 by Darren Reed. @@ -1054,7 +1054,7 @@ ipf_state_putent(softc, softs, data) /* to pointers and adjusts running stats for the hash table as appropriate. */ /* */ /* This function can fail if the filter rule has had a population policy of */ -/* IP addresses used with stateful filteirng assigned to it. */ +/* IP addresses used with stateful filtering assigned to it. */ /* */ /* Locking: it is assumed that some kind of lock on ipf_state is held. */ /* Exits with is_lock initialised and held - *EVEN IF ERROR*. */ @@ -1081,7 +1081,7 @@ ipf_state_insert(softc, is, rev) } /* - * If we could trust is_hv, then the modulous would not be needed, + * If we could trust is_hv, then the modulus would not be needed, * but when running with IPFILTER_SYNC, this stops bad values. */ hv = is->is_hv % softs->ipf_state_size; @@ -1672,6 +1672,10 @@ ipf_state_add(softc, fin, stsave, flags) SBUMPD(ipf_state_stats, iss_bucket_full); return 4; } + + /* + * No existing state; create new + */ KMALLOC(is, ipstate_t *); if (is == NULL) { SBUMPD(ipf_state_stats, iss_nomem); @@ -1683,7 +1687,7 @@ ipf_state_add(softc, fin, stsave, flags) is->is_rule = fr; /* - * Do not do the modulous here, it is done in ipf_state_insert(). + * Do not do the modulus here, it is done in ipf_state_insert(). */ if (fr != NULL) { ipftq_t *tq; @@ -1711,7 +1715,7 @@ ipf_state_add(softc, fin, stsave, flags) /* * It may seem strange to set is_ref to 2, but if stsave is not NULL * then a copy of the pointer is being stored somewhere else and in - * the end, it will expect to be able to do osmething with it. + * the end, it will expect to be able to do something with it. */ is->is_me = stsave; if (stsave != NULL) { @@ -3652,7 +3656,6 @@ ipf_state_del(softc, is, why) softs->ipf_state_stats.iss_orphan++; return refs; } - MUTEX_EXIT(&is->is_lock); fr = is->is_rule; is->is_rule = NULL; @@ -3664,6 +3667,7 @@ ipf_state_del(softc, is, why) } is->is_ref = 0; + MUTEX_EXIT(&is->is_lock); if (is->is_tqehead[0] != NULL) { if (ipf_deletetimeoutqueue(is->is_tqehead[0]) == 0)