From nobody Mon May 4 16:51:12 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4g8SMh6KsTz6brGw for ; Mon, 04 May 2026 16:51:12 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4g8SMh2zbVz3w9Y for ; Mon, 04 May 2026 16:51:12 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777913472; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XqTUJ2SaK36Ry7P0xCkQNAU4OaojKnPnAr0Pkb5W4tE=; b=GV5HlHyoMuQgB2DRTvftDrC9GqdTWoHlPnKRHnyr6694MfrxbWAJR3+3eXA/sZIIiw96+6 hSRy6TAmJZAP3ig9k1jSAYe/IjtoIXIO1h2DLulbiYTvHizbS2LgpdUP9w80tflpVMycqe qzw0CNWekDXT0B/J1XWiWUkwH4EbVk7M9iwExAeXLu8xnCjUZ3aqEBBT2VcIVKjpxHwie+ aTe023k9CCTj61p3EQyrE2VTlLXIvcDmiX9NX2VkScxBaZkPEJLLm60GoinBt3DEuqrJoR jTsxLw7KRILP6MvFCrngmauianI0nY5v8jAueagiTYBwiOS16/DwwtZj3VX5Jg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1777913472; a=rsa-sha256; cv=none; b=rJkJSlbWCuOuCS2Qiy194iR760asNjegi2THturJEw5hK483/IS8K9utUgh43CjN9kw0Zk cmxWbhV2yCqgIaj0l/9TDk5BdbuVnLibAwlrVt8nhv9EPnCuw+LQUvLjKBypCj2Yty59CD giWw7c7ePaDIHyE2G9jpKl9a8ryPkpvNtMTy/2VCu0tzHeUJJlc7UiO1KzPCIbbC8hA5ZQ PaLr/1fQy5+sWH6KfpMxQ5IyGHreW60SgiOHhiqKlbnAZs0+SHru7CyKGDKwbULG6BhWyf T7FVgNOHvRnsvLgslEMYLOnJ6WuSKb7LL22iz91g4yBJQ/ZixX0J/HGpiUFYwA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777913472; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XqTUJ2SaK36Ry7P0xCkQNAU4OaojKnPnAr0Pkb5W4tE=; b=wf4aAivk3qKLoPARwzHR+SlteoXcNPvTpzLJracimJxtGfoWxXGtipHsuAz48YuxcHtCQn U01+Kmar+Of7FXVQ4j8LP6IZRAGF0P0RQhukcG/XB8w/hnZ32R0nEhrk5q18UWRtWx01MC 2mpecxgWGweZVAv9GDfdKizc9HVJpg9ySeHlScSkN5tq5P59TQwcn/GzhMRkYmQZCm7ZBU NAgvbfKsBMsa2oQC6MZXQyIrsS2DiRze58qR6L4jF76RM0cOhVXHVzaYVMGrhEfPEORCkv TPgc40coY1NNomwTjm4CLIzjItm9Bic3smVunFFtlV2Tf+2KfVVyw6yk+kXX2Q== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4g8SMh2Z7xzCpJ for ; Mon, 04 May 2026 16:51:12 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 27844 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 04 May 2026 16:51:12 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: bc73c7f61912 - stable/14 - ifnet: Remove unreachable code List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: zlei X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: bc73c7f6191211b254f8cc87aab71d5ff853e24d Auto-Submitted: auto-generated Date: Mon, 04 May 2026 16:51:12 +0000 Message-Id: <69f8ce80.27844.3fac1349@gitrepo.freebsd.org> The branch stable/14 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=bc73c7f6191211b254f8cc87aab71d5ff853e24d commit bc73c7f6191211b254f8cc87aab71d5ff853e24d Author: Zhenlei Huang AuthorDate: 2026-03-16 17:03:05 +0000 Commit: Zhenlei Huang CommitDate: 2026-05-04 16:49:40 +0000 ifnet: Remove unreachable code The ioctls SIOCSIFVNET and SIOCSIFRVNET are for userland only. For SIOCSIFVNET, if_vmove_loan(), the interface is obtained from current VNET. For SIOCSIFRVNET, if_vmove_reclaim(), a valid child prison is held before getting the interface. In both cases the VNET of the obtained interfaces is stable, so there's no need to check it. No functional change intended. Reviewed by: glebius, jamie (for #jails) MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D55828 (cherry picked from commit e0731059af912a27d0f842959218946b1daaa7d1) (cherry picked from commit a989b0fbc965b453d97e3d032efb4f9c7592734a) --- sys/net/if.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index 44f80a51eea8..2245863bda83 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1301,7 +1301,6 @@ if_vmove_loan(struct thread *td, struct ifnet *ifp, char *ifname, int jid) struct prison *pr; struct ifnet *difp; bool found; - bool shutdown; MPASS(ifindex_table[ifp->if_index].ife_ifnet == ifp); @@ -1331,14 +1330,6 @@ if_vmove_loan(struct thread *td, struct ifnet *ifp, char *ifname, int jid) } sx_xlock(&ifnet_detach_sxlock); - /* Make sure the VNET is stable. */ - shutdown = VNET_IS_SHUTTING_DOWN(ifp->if_vnet); - if (shutdown) { - sx_xunlock(&ifnet_detach_sxlock); - prison_free(pr); - return (EBUSY); - } - found = if_unlink_ifnet(ifp, true); if (! found) { sx_xunlock(&ifnet_detach_sxlock); @@ -1365,7 +1356,6 @@ if_vmove_reclaim(struct thread *td, char *ifname, int jid) struct vnet *vnet_dst; struct ifnet *ifp; int found __diagused; - bool shutdown; /* Try to find the prison within our visibility. */ sx_slock(&allprison_lock); @@ -1393,14 +1383,6 @@ if_vmove_reclaim(struct thread *td, char *ifname, int jid) return (EEXIST); } - /* Make sure the VNET is stable. */ - shutdown = VNET_IS_SHUTTING_DOWN(ifp->if_vnet); - if (shutdown) { - CURVNET_RESTORE(); - prison_free(pr); - return (EBUSY); - } - /* Get interface back from child jail/vnet. */ found = if_unlink_ifnet(ifp, true); MPASS(found);