From owner-svn-src-head@freebsd.org Fri May 11 21:42:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2FE3FCF373; Fri, 11 May 2018 21:42:28 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 534E579E48; Fri, 11 May 2018 21:42:28 +0000 (UTC) (envelope-from shurd@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 357B71540E; Fri, 11 May 2018 21:42:28 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w4BLgR69088068; Fri, 11 May 2018 21:42:27 GMT (envelope-from shurd@FreeBSD.org) Received: (from shurd@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w4BLgRK6088066; Fri, 11 May 2018 21:42:27 GMT (envelope-from shurd@FreeBSD.org) Message-Id: <201805112142.w4BLgRK6088066@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: shurd set sender to shurd@FreeBSD.org using -f From: Stephen Hurd Date: Fri, 11 May 2018 21:42:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r333505 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: shurd X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 333505 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 May 2018 21:42:29 -0000 Author: shurd Date: Fri May 11 21:42:27 2018 New Revision: 333505 URL: https://svnweb.freebsd.org/changeset/base/333505 Log: Fix LORs in in6?_leave_group() r333175 updated the join_group functions, but not the leave_group ones. Reviewed by: sbruno Sponsored by: Limelight Networks Differential Revision: https://reviews.freebsd.org/D15393 Modified: head/sys/netinet/in_mcast.c head/sys/netinet6/in6_mcast.c Modified: head/sys/netinet/in_mcast.c ============================================================================== --- head/sys/netinet/in_mcast.c Fri May 11 20:47:45 2018 (r333504) +++ head/sys/netinet/in_mcast.c Fri May 11 21:42:27 2018 (r333505) @@ -2501,6 +2501,8 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop /* * Begin state merge transaction at IGMP layer. */ + in_pcbref(inp); + INP_WUNLOCK(inp); IN_MULTI_LOCK(); if (is_final) { @@ -2531,6 +2533,9 @@ inp_leave_group(struct inpcb *inp, struct sockopt *sop out_in_multi_locked: IN_MULTI_UNLOCK(); + INP_WLOCK(inp); + if (in_pcbrele_wlocked(inp)) + return (ENXIO); if (error) imf_rollback(imf); Modified: head/sys/netinet6/in6_mcast.c ============================================================================== --- head/sys/netinet6/in6_mcast.c Fri May 11 20:47:45 2018 (r333504) +++ head/sys/netinet6/in6_mcast.c Fri May 11 21:42:27 2018 (r333505) @@ -2381,6 +2381,8 @@ in6p_leave_group(struct inpcb *inp, struct sockopt *so /* * Begin state merge transaction at MLD layer. */ + in_pcbref(inp); + INP_WUNLOCK(inp); IN6_MULTI_LOCK(); if (is_final) { @@ -2407,6 +2409,9 @@ in6p_leave_group(struct inpcb *inp, struct sockopt *so } IN6_MULTI_UNLOCK(); + INP_WLOCK(inp); + if (in_pcbrele_wlocked(inp)) + return (ENXIO); if (error) im6f_rollback(imf);