From nobody Thu Apr 30 09:53:18 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 4g5qHL6nmrz6bWRJ for ; Thu, 30 Apr 2026 09:53:18 +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 4g5qHL5wGMz3DNG for ; Thu, 30 Apr 2026 09:53:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1777542798; 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=hjh0i+PI4C05BNXAVoOQUazKG0dNPI0ofKzlyb5yKic=; b=wlndi/6J6BmtL6MUFO7kYM5tCsN/C8rsHy1uhmCw80odWJ5hyGprPuXMlIYCL6BURA6jlY xjG+HtNz5tT3rfD6Sgpc/AAMkpzqbxiiTQjxBjFEnEJFUuH8oNqYsox6gqprt+HQGhQnoL Mi20Big/NW72KYhPL1aPknYd3rDj76x17jWPziGVvy8zrAxUf25tXFSiPmQQB5U4RTH5ZS WyXQCwInf4YVAFxwnVo+ra2GAc3aobT8lLm4z6uKYuC/CoRwzlysRmOUMYw8wnP7mZPlyg 144l7CQbT1RkhchN8XPNGyaAZpPbdH2gltBFgpcvfCahiqAy7fL+l8QIooziXA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1777542798; a=rsa-sha256; cv=none; b=DmI+RvIqA3B/h6AfVPwsHJT5dvnbctsfqH6qMnnWitEdhRLP3KqSKeHLEAfMwVi9WYH1pp gO2DVsIKxm8/CecDbi0rHX+6whogHxPBC15rmpKKMZg8u3skwhasw7e2Q04BriyoTAQnCp 4YVT31HysAf7Ok3gXUts6qBreVrPTrGIdjZ0HB7C9FeONG93IXXQh94tUpLSTvE2SRqP0j aIV2gHZgBnl9CpbH4BBheVpBtXGuKKF4rPEkhOE5Ng3tkZDxA5uSf1ekF9Z6+3vXI6k+zi yoJ04IsB6ts2L0YPVskmbwcgItqBNAMed21prYhOJkGpP6nvBjxTxGgmwN09Ww== 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=1777542798; 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=hjh0i+PI4C05BNXAVoOQUazKG0dNPI0ofKzlyb5yKic=; b=LpXl1qgwCrU7AwjfCsFAbe/JIzKwUhgbaAZzSrvpelMELUVNIoP8TVvUk5I8Ah2iromLH2 Wylm2DYczfuKNsm85dLTpwCM8ByhmCURGJIxxn60uFgLz4+GfaBxVoCHAu1m2A24zoQVtD nje+Q0lEcnv3vhTXrJnoTVFx/FMM1+aBs0qHmchkD06sFPgtSoWHUjYqpgxFRQQkD2zAOC r5EHCgEzLRprVUxkr6pwWEw4cvE0zIFN7K/jN5GmIHAmyaSwkjbvWk6qahH8CR9WxMx//D PSXtovb5o6HX54fLCN20eEjLJvDLbpJIXje7n2gLvdgpZ3Mc2REgKFCNTz67ZQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4g5qHL5LkTz1L8C for ; Thu, 30 Apr 2026 09:53:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 47024 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 30 Apr 2026 09:53:18 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Zhenlei Huang Subject: git: a989b0fbc965 - stable/15 - 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 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/15 X-Git-Reftype: branch X-Git-Commit: a989b0fbc965b453d97e3d032efb4f9c7592734a Auto-Submitted: auto-generated Date: Thu, 30 Apr 2026 09:53:18 +0000 Message-Id: <69f3268e.47024.7e6a3680@gitrepo.freebsd.org> The branch stable/15 has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=a989b0fbc965b453d97e3d032efb4f9c7592734a commit a989b0fbc965b453d97e3d032efb4f9c7592734a Author: Zhenlei Huang AuthorDate: 2026-03-16 17:03:05 +0000 Commit: Zhenlei Huang CommitDate: 2026-04-30 09:51:59 +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) --- sys/net/if.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index 9ea5f9778d98..71a4585ae7eb 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1297,7 +1297,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); @@ -1327,14 +1326,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); @@ -1361,7 +1352,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); @@ -1389,14 +1379,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);