From nobody Fri May 27 16:23:30 2022 X-Original-To: dev-commits-src-branches@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 1D3981B4FBA6; Fri, 27 May 2022 16:23:31 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4L8qqR02mGz3sfB; Fri, 27 May 2022 16:23:31 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653668611; 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=aj+bwN0ANP4e0c9f2Terav9rmblModimtj1b5xoemjY=; b=I2LymNiu4sgMH8CEZ34vyAzN9Gek+hvJ0WhWNTo8JGpfd5LQw7fyQh6c2Dg+oLXUZkDjuQ DxJKCZmYZ8LtVe9rr5xcVDyuuVBfct2N5eJsVlrRk8X9i9p41DxzlqU1HsP+0QW1h7B2a8 5WVKwNrTtKm01p46gEtKkeS9pgmS5oILMT/XTZMsf47TIcGua9RSFhv2l59jqNVf/EVf+4 mTZY30NYk3EYNJRlZYoDNyff5zcwa3P6OJdHjBT3KcPG7YDROJfgkaMcs5eerd3gKU6J45 /JetGdH/XL112X0THdNcBm4jtzgeqMMOE26TRdbmibxrOxSrM97b71sJBKkOKQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CFB002565E; Fri, 27 May 2022 16:23:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 24RGNUDn096634; Fri, 27 May 2022 16:23:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24RGNURQ096633; Fri, 27 May 2022 16:23:30 GMT (envelope-from git) Date: Fri, 27 May 2022 16:23:30 GMT Message-Id: <202205271623.24RGNURQ096633@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Mitchell Horne Subject: git: 91d4608d2165 - stable/13 - netdump: check the support status of the interface List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mhorne X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 91d4608d21657cb6064f893001380a2f08da26a9 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1653668611; 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=aj+bwN0ANP4e0c9f2Terav9rmblModimtj1b5xoemjY=; b=cC0HQMbrbUse1u5MAIufKgZ5jAbV/s0DZXN/MzucJJDu/TssTygMcak/xMUPVVBxE7tI0j 4qAD+Pm62ZPK7qvn/yGA9mccRhT+fQZuIN2enFej7g1+J/LFRWPsTnBjbMBPlqb1cdbQ52 45ETvYps5OmBIoB2NpUVeoWH3Qsx6z4rT05XuLvLZ88RLVZQKrfR5xBa/Rdvxlvxzb8F8g Z31ejRt3xhYnRVDxF7TNa/rSxPJ7d0A9RoCU+W2MF8hVzh8qtZCkQegMj/JFrAp5l02ZiI RkYHQ9SMPWlT8PFgB9FO168KVyye1WJzrqcIPbqAb3tWJcqnc8kcr03/qwDH2g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1653668611; a=rsa-sha256; cv=none; b=DSh+NPbhEP2Hyd1L4Zr21yxDzN2v83a5ETB1ZYeIa4QpEW5Vp2Utvm6rTjF6H50Ool3NG9 gpezwOIsokDiLK/QDgQHkQKpzEO/aO9gJKOzHdhTW6vPhHuVESkAL5YwBlPqexP9MlQN5u lc85R4DIX2b5b8ZNjuNGwZhfdtM7QoLaZux1SJDAahcM2nQG6kWdYx+BQjhy5bJBNXwr5P uU1sjRhPD/Rm2pJQVWUEixJpSszjY2kbi0fF0LEwSDYm76oUDFTQLhdaYqhgm4peKtR0Z+ I4xtX1Rm6TBBZmCt9H+GnILkx87KSyl0NJ0u8OMyMc/41+0xHCgYMzVYOGtZUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=91d4608d21657cb6064f893001380a2f08da26a9 commit 91d4608d21657cb6064f893001380a2f08da26a9 Author: Mitchell Horne AuthorDate: 2022-05-14 13:23:58 +0000 Commit: Mitchell Horne CommitDate: 2022-05-27 16:22:47 +0000 netdump: check the support status of the interface If the interface does not support debugnet(4) we should bail early, rather than having the user find this out at the time of the panic. dumpon(8) already expects this return value and will print a helpful error message. Reviewed by: cem, markj MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D35180 (cherry picked from commit 38a36057ae56c8023878f3c3c2185bafc2896964) --- sys/netinet/netdump/netdump_client.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/netinet/netdump/netdump_client.c b/sys/netinet/netdump/netdump_client.c index 7b9d260bff44..dc209062b359 100644 --- a/sys/netinet/netdump/netdump_client.c +++ b/sys/netinet/netdump/netdump_client.c @@ -420,6 +420,10 @@ netdump_configure(struct diocskerneldump_arg *conf, struct thread *td) CURVNET_SET(vnet0); ifp = ifunit_ref(conf->kda_iface); CURVNET_RESTORE(); + if (!DEBUGNET_SUPPORTED_NIC(ifp)) { + if_rele(ifp); + return (ENODEV); + } } else ifp = NULL;