aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMitchell Horne <mhorne@FreeBSD.org>2022-05-14 13:23:58 +0000
committerMitchell Horne <mhorne@FreeBSD.org>2022-05-27 16:22:47 +0000
commit91d4608d21657cb6064f893001380a2f08da26a9 (patch)
tree9e8f54cdbfc816fd0bdf038e080e6f3a65777262
parent6350ace614fc329b786f063e6633c191b8dedadb (diff)
downloadsrc-91d4608d21657cb6064f893001380a2f08da26a9.tar.gz
src-91d4608d21657cb6064f893001380a2f08da26a9.zip
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)
-rw-r--r--sys/netinet/netdump/netdump_client.c4
1 files changed, 4 insertions, 0 deletions
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;