From nobody Mon Mar 16 17:04:02 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 4fZLz61ND5z6VgDC for ; Mon, 16 Mar 2026 17:04:02 +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 "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fZLz60lpkz3ky5 for ; Mon, 16 Mar 2026 17:04:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1773680642; 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=fsGEECYf8LgLyr9E1J5VJjkL4JVW9d9d6gMOSsLFmeo=; b=FNQSQWMuylyQkdVRarXKUPvfcT5wwrD2uTp7Lvvql1aoUQp/IwgO4kEK7SkYUFsJDlgy4p M2u4jksWGKY4bubhH7V6IjSDWQN0/6Lcp2Cp0DClTR/9XFP5oLsYzu/61K9WT9dLd6WPRB Ue+YXpHZ4cpJbckGa3SD8RgLqrhQKlJmvg0Us1fVJo67kNLnAVtGl6KRSNfNThDPVYYWw+ vMZl1V93bIW7nczn1fp2xdypH5oic4P+VyIJMlJlzfRwwsjqB5FnH02hW2ECTz5Zw/dmJm DpOKFSeZaBxjuUdbRiN67hcXhoa27qPv7J0miY2s2VOTG08HEhAdPlZ4YdJzbA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1773680642; a=rsa-sha256; cv=none; b=wcwhSEaH5rWJ45IUGvLy4Auc2izCSRhQphm5soQskHAxFw2YM04gcC6MOT0JUkn8lGcioY 7bbmgzCcet/oaguZkuuqNbeCKhtV56ejO9DzKHp4UGMSNvBSNLCbM3sUP8RDHHYa/PlyW6 QsP2kfyy4LTYxeWZ/V5EWXi+ClHav8dVazUQfRuiZvT5F2Eh+uMwEW8al5KsQg9LelCb+s WUz6wHPap40jf8mMSMJJmkfnxjHPqfIzMsWhXqDg522cmYTH5YImQImDGsPGeRjuu1tgjD s/4GkohIXKtqyYBjBa8aGKQRNwK1jN7loWund9vjwlSLec5Fd86+2gijFNMxcg== 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=1773680642; 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=fsGEECYf8LgLyr9E1J5VJjkL4JVW9d9d6gMOSsLFmeo=; b=ZR5Pb0XhvDThmHP+9NSIdLORtZrEYreE5+u4Twqz+Nf6y21IS8dkLESIEq6jEktLXBUjiV s2MjTSsRO1NyHgf3MXlU7Agc+U6QinSZpjTU8bLgRwWN3EgGDTWCXHlYr3qiqUWIySJJT+ fUbTzEgRRyvOvveEa72DJ0XbChO3cMevcYJ4JBPjGwPyRQI191qXpzAQDlZ6war4Xp3R8h wp7DMyGfB5J7lifs+NPBpFrb9vgW9/gWEr4n79qEqkHMO3wLV2Le+DYQpyCic4ZLqL98yi k7Kh329rYp9j9deZaCEWPE7zWQn7jqmCe+WfkBn2PiI7ZNWFTpd0RsevhQ9Bcw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4fZLz609Cvzkkt for ; Mon, 16 Mar 2026 17:04:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 21636 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Mon, 16 Mar 2026 17:04:02 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Zhenlei Huang Subject: git: e0731059af91 - main - 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/main X-Git-Reftype: branch X-Git-Commit: e0731059af912a27d0f842959218946b1daaa7d1 Auto-Submitted: auto-generated Date: Mon, 16 Mar 2026 17:04:02 +0000 Message-Id: <69b83802.21636.428d9997@gitrepo.freebsd.org> The branch main has been updated by zlei: URL: https://cgit.FreeBSD.org/src/commit/?id=e0731059af912a27d0f842959218946b1daaa7d1 commit e0731059af912a27d0f842959218946b1daaa7d1 Author: Zhenlei Huang AuthorDate: 2026-03-16 17:03:05 +0000 Commit: Zhenlei Huang CommitDate: 2026-03-16 17:03:05 +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 --- sys/net/if.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/sys/net/if.c b/sys/net/if.c index c3f31a28b40d..41084ecf0516 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1188,7 +1188,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); @@ -1218,14 +1217,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); @@ -1252,7 +1243,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); @@ -1280,14 +1270,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);