Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ppbus When refactoring interface drivers after netbs...



details:   https://anonhg.NetBSD.org/src/rev/d83013915aef
branches:  trunk
changeset: 445610:d83013915aef
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Mon Nov 05 18:37:18 2018 +0000

description:
When refactoring interface drivers after netbsd-4, the SIOCINITIFADDR
ioctl was passed through ifioctl_common, because the case falls through
to the SIOCSIFFLAGS case. The common handler however doesn't implement
SIOCINITIFADDR, so an attempt to configure plip always failed with ENOTTY.

diffstat:

 sys/dev/ppbus/if_plip.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (31 lines):

diff -r 553d8d1e8459 -r d83013915aef sys/dev/ppbus/if_plip.c
--- a/sys/dev/ppbus/if_plip.c   Mon Nov 05 17:44:09 2018 +0000
+++ b/sys/dev/ppbus/if_plip.c   Mon Nov 05 18:37:18 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_plip.c,v 1.31 2018/07/25 07:55:45 msaitoh Exp $ */
+/* $NetBSD: if_plip.c,v 1.32 2018/11/05 18:37:18 mlelstv Exp $ */
 
 /*-
  * Copyright (c) 1997 Poul-Henning Kamp
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_plip.c,v 1.31 2018/07/25 07:55:45 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_plip.c,v 1.32 2018/11/05 18:37:18 mlelstv Exp $");
 
 /*
  * Parallel port TCP/IP interfaces added.  I looked at the driver from
@@ -375,8 +375,10 @@
                ifp->if_flags |= IFF_UP;
        /* FALLTHROUGH */
        case SIOCSIFFLAGS:
-               if ((error = ifioctl_common(ifp, cmd, data)) != 0)
-                       break;
+               if (cmd == SIOCSIFFLAGS) {
+                       if ((error = ifioctl_common(ifp, cmd, data)) != 0)
+                               break;
+               }
                if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) == IFF_UP) {
                        if ((error = ppbus_request_bus(ppbus, dev, 0, 0)))
                                break;



Home | Main Index | Thread Index | Old Index