From nobody Sat May 14 13:28:46 2022 X-Original-To: dev-commits-src-main@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 02C8E1AE1D25; Sat, 14 May 2022 13:28:47 +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 4L0mYp4gKTz4fpx; Sat, 14 May 2022 13:28:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652534926; 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=rSfOZ2+Iw3i434xHPyr09KBowIzcIjj/Uqd2JxY2QuM=; b=SMhy2fq6idXVBRfZkpNUMEJoV55uCa/18lOYNPdg2HOZ89J89p7yFuh7wwhXOnOjAs5DOQ w6zlVGOw1OlFtEfPAXljHNhXWcNxu5TEubH7tFTjeZT/Tfje9cse95Gg26z3NyBIiAYMyS Qz7eW6u4iTARce2m9qXW6+P/sDLR4SYEfpdpB6hyYKoNtN4A4HBtWG9EvuraI5hUDqSgfe WtLANa2hji4mLUtzGxC2zaxV1btis572gzGBl5emKg4c77JGddGCAw96PemNxmg7PN3fth hdvhmVejIsvxFpMXRbcK6weiXP0mZdc2tBSzSaqWGh8bS3HH7UfKciw55fi7Zw== 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 6B989182E9; Sat, 14 May 2022 13:28:46 +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 24EDSk5t051347; Sat, 14 May 2022 13:28:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24EDSkqV051346; Sat, 14 May 2022 13:28:46 GMT (envelope-from git) Date: Sat, 14 May 2022 13:28:46 GMT Message-Id: <202205141328.24EDSkqV051346@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mitchell Horne Subject: git: 38a36057ae56 - main - netdump: check the support status of the interface List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 38a36057ae56c8023878f3c3c2185bafc2896964 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652534926; 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=rSfOZ2+Iw3i434xHPyr09KBowIzcIjj/Uqd2JxY2QuM=; b=DviAd4nczXaXE73mbj/84MWY2iN9RMxbZkf9MCi2sdBr/2e/839joOpUo5r7AKY+JsPoZj vOeRi2IrYIsRRtDIW/417DDG+8IIVoxV9g99cysuTL8ZWzwgiJJZW5U8PCU63xYf2scSBg fuQrMBhk+g6PKjFgNnIiCQE1Sukrdpt0goAZuzVFuJrCCY07UUQddHIqEdInxi95SHfT3u /8QA+kWgvhMZTcwZT8X8B0kf0vtdHkyH/f5ZYZ1b9RAtAoE4zorHcqH286l8ScDoRkuvKe KvQWVFQY52ZJf/VtJBjs47CUZkGc3ZeCmNHZQGt71uxmO644+grAK0bo4bBHzw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1652534926; a=rsa-sha256; cv=none; b=iS/Cro4YhdFlEAt52zDQV2x61jfnv1EuKM6+ReEcq3DKM0AskFX+cYBfQ5Mg3sYYFB5bX/ f+6IzvuHoE3A6MfJTlgcvcvlsr2cX/xo69Kx6k8P1W9nGjyVa+7WqkYqZfe0VscfAETCYR K0YGHYYLc/WG4pmGpect5PcWyhvyoQiBXkWoeULDGPm8uwocwXE7vs/HN0cQa5SKk+H9e9 VojRjpsme9Z3N2qKBfo+ykUZrC3zs56jneFUaRsnI1UOXqKKpW6+PPGO1krAnt3Aw9w+O3 iQoFZw27fTC00QlTAwtaztE7iSg91qWrfljYeQKXcAJVDdjsuLLgPrBRhGi9sw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mhorne: URL: https://cgit.FreeBSD.org/src/commit/?id=38a36057ae56c8023878f3c3c2185bafc2896964 commit 38a36057ae56c8023878f3c3c2185bafc2896964 Author: Mitchell Horne AuthorDate: 2022-05-14 13:23:58 +0000 Commit: Mitchell Horne CommitDate: 2022-05-14 13:27:53 +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 --- 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 9f7b6d7965b8..9f7b3da8ea5e 100644 --- a/sys/netinet/netdump/netdump_client.c +++ b/sys/netinet/netdump/netdump_client.c @@ -452,6 +452,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;