svn commit: r346448 - head/sys/netinet/netdump

Conrad Meyer cem at FreeBSD.org
Sat Apr 20 16:07:30 UTC 2019


Author: cem
Date: Sat Apr 20 16:07:29 2019
New Revision: 346448
URL: https://svnweb.freebsd.org/changeset/base/346448

Log:
  netdump: Fix 11 compatibility DIOCSKERNELDUMP ioctl
  
  The logic was present for the 11 version of the DIOCSKERNELDUMP ioctl, but
  had not been updated for the 12 ABI.
  
  Reviewed by:	markj
  Differential Revision:	https://reviews.freebsd.org/D19980

Modified:
  head/sys/netinet/netdump/netdump_client.c

Modified: head/sys/netinet/netdump/netdump_client.c
==============================================================================
--- head/sys/netinet/netdump/netdump_client.c	Sat Apr 20 16:05:04 2019	(r346447)
+++ head/sys/netinet/netdump/netdump_client.c	Sat Apr 20 16:07:29 2019	(r346448)
@@ -1144,13 +1144,25 @@ netdump_ioctl(struct cdev *dev __unused, u_long cmd, c
 
 	error = 0;
 	switch (cmd) {
-	case DIOCSKERNELDUMP:
+#ifdef COMPAT_FREEBSD11
+	case DIOCSKERNELDUMP_FREEBSD11:
 		u = *(u_int *)addr;
 		if (u != 0) {
 			error = ENXIO;
 			break;
 		}
-
+		if (nd_enabled) {
+			nd_enabled = 0;
+			netdump_mbuf_drain();
+		}
+		break;
+#endif
+	case DIOCSKERNELDUMP:
+		kda = (void *)addr;
+		if (kda->kda_enable != 0) {
+			error = ENXIO;
+			break;
+		}
 		if (nd_enabled) {
 			nd_enabled = 0;
 			netdump_mbuf_drain();


More information about the svn-src-all mailing list