From owner-svn-src-head@freebsd.org Fri Oct 25 18:54:07 2019 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 12DF21585E7; Fri, 25 Oct 2019 18:54:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 470CvL6kV5z3PQV; Fri, 25 Oct 2019 18:54:06 +0000 (UTC) (envelope-from bz@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 CB9012ABB5; Fri, 25 Oct 2019 18:54:06 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9PIs6JH047469; Fri, 25 Oct 2019 18:54:06 GMT (envelope-from bz@FreeBSD.org) Received: (from bz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9PIs6Vf047467; Fri, 25 Oct 2019 18:54:06 GMT (envelope-from bz@FreeBSD.org) Message-Id: <201910251854.x9PIs6Vf047467@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bz set sender to bz@FreeBSD.org using -f From: "Bjoern A. Zeeb" Date: Fri, 25 Oct 2019 18:54:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354092 - in head/sys: netinet netinet6 X-SVN-Group: head X-SVN-Commit-Author: bz X-SVN-Commit-Paths: in head/sys: netinet netinet6 X-SVN-Commit-Revision: 354092 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.29 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, 25 Oct 2019 18:54:07 -0000 Author: bz Date: Fri Oct 25 18:54:06 2019 New Revision: 354092 URL: https://svnweb.freebsd.org/changeset/base/354092 Log: Properly set VNET when nuking recvif from fragment queues. In theory the eventhandler invoke should be in the same VNET as the the current interface. We however cannot guarantee that for all cases in the future. So before checking if the fragmentation handling for this VNET is active, switch the VNET to the VNET of the interface to always get the one we want. Reviewed by: hselasky MFC after: 3 weeks Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D22153 Modified: head/sys/netinet/ip_reass.c head/sys/netinet6/frag6.c Modified: head/sys/netinet/ip_reass.c ============================================================================== --- head/sys/netinet/ip_reass.c Fri Oct 25 18:46:53 2019 (r354091) +++ head/sys/netinet/ip_reass.c Fri Oct 25 18:54:06 2019 (r354092) @@ -632,14 +632,17 @@ ipreass_cleanup(void *arg __unused, struct ifnet *ifp) KASSERT(ifp != NULL, ("%s: ifp is NULL", __func__)); + CURVNET_SET_QUIET(ifp->if_vnet); + /* * Skip processing if IPv4 reassembly is not initialised or * torn down by ipreass_destroy(). */ - if (V_ipq_zone == NULL) + if (V_ipq_zone == NULL) { + CURVNET_RESTORE(); return; + } - CURVNET_SET_QUIET(ifp->if_vnet); for (i = 0; i < IPREASS_NHASH; i++) { IPQ_LOCK(i); /* Scan fragment list. */ Modified: head/sys/netinet6/frag6.c ============================================================================== --- head/sys/netinet6/frag6.c Fri Oct 25 18:46:53 2019 (r354091) +++ head/sys/netinet6/frag6.c Fri Oct 25 18:54:06 2019 (r354092) @@ -307,16 +307,18 @@ frag6_cleanup(void *arg __unused, struct ifnet *ifp) KASSERT(ifp != NULL, ("%s: ifp is NULL", __func__)); + CURVNET_SET_QUIET(ifp->if_vnet); #ifdef VIMAGE /* * Skip processing if IPv6 reassembly is not initialised or * torn down by frag6_destroy(). */ - if (!V_frag6_on) + if (!V_frag6_on) { + CURVNET_RESTORE(); return; + } #endif - CURVNET_SET_QUIET(ifp->if_vnet); for (bucket = 0; bucket < IP6REASS_NHASH; bucket++) { IP6QB_LOCK(bucket); head = IP6QB_HEAD(bucket);