Module Name:    src
Committed By:   maya
Date:           Wed Aug  7 10:01:05 UTC 2019

Modified Files:
        src/sys/dev/usb: usbnet.c

Log Message:
Don't tell userland about ENETRESET even if a usbnet driver didn't define
un_ioctl_cb.


To generate a diff of this commit:
cvs rdiff -u -r1.8 -r1.9 src/sys/dev/usb/usbnet.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/usbnet.c
diff -u src/sys/dev/usb/usbnet.c:1.8 src/sys/dev/usb/usbnet.c:1.9
--- src/sys/dev/usb/usbnet.c:1.8	Wed Aug  7 01:47:18 2019
+++ src/sys/dev/usb/usbnet.c	Wed Aug  7 10:01:05 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbnet.c,v 1.8 2019/08/07 01:47:18 mrg Exp $	*/
+/*	$NetBSD: usbnet.c,v 1.9 2019/08/07 10:01:05 maya Exp $	*/
 
 /*
  * Copyright (c) 2019 Matthew R. Green
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.8 2019/08/07 01:47:18 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.9 2019/08/07 10:01:05 maya Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -817,8 +817,12 @@ usbnet_ioctl(struct ifnet *ifp, u_long c
 		return (*un->un_override_ioctl_cb)(ifp, cmd, data);
 
 	error = ether_ioctl(ifp, cmd, data);
-	if (error == ENETRESET && un->un_ioctl_cb)
-		error = (*un->un_ioctl_cb)(ifp, cmd, data);
+	if (error == ENETRESET) {
+		if (un->un_ioctl_cb)
+			error = (*un->un_ioctl_cb)(ifp, cmd, data);
+		else
+			error = 0;
+	}
 
 	return error;
 }

Reply via email to