Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/common Fix a bug that SIOC[GZ]IFDATA returned old...



details:   https://anonhg.NetBSD.org/src/rev/a6ffb77cb39a
branches:  trunk
changeset: 433384:a6ffb77cb39a
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Wed Sep 12 02:24:25 2018 +0000

description:
Fix a bug that SIOC[GZ]IFDATA returned old ifreq structure.

diffstat:

 sys/compat/common/uipc_syscalls_50.c |  19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diffs (50 lines):

diff -r 8f1f4eefad44 -r a6ffb77cb39a sys/compat/common/uipc_syscalls_50.c
--- a/sys/compat/common/uipc_syscalls_50.c      Tue Sep 11 10:06:53 2018 +0000
+++ b/sys/compat/common/uipc_syscalls_50.c      Wed Sep 12 02:24:25 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_syscalls_50.c,v 1.5 2018/04/26 08:11:18 roy Exp $ */
+/*     $NetBSD: uipc_syscalls_50.c,v 1.6 2018/09/12 02:24:25 msaitoh Exp $     */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_50.c,v 1.5 2018/04/26 08:11:18 roy Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls_50.c,v 1.6 2018/09/12 02:24:25 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -65,23 +65,24 @@
 
        /* Validate arguments. */
        switch (cmd) {
-       case SIOCGIFDATA:
-       case SIOCZIFDATA:
-               ifp = ifunit(ifdr->ifdr_name);
-               if (ifp == NULL)
-                       return ENXIO;
+       case OSIOCGIFDATA:
+       case OSIOCZIFDATA:
                break;
        default:
                return ENOSYS;
        }
 
+       ifp = ifunit(ifdr->ifdr_name);
+       if (ifp == NULL)
+               return ENXIO;
+
        /* Do work. */
        switch (cmd) {
-       case SIOCGIFDATA:
+       case OSIOCGIFDATA:
                ifdatan2o(&ifdr->ifdr_data, &ifp->if_data);
                return 0;
 
-       case SIOCZIFDATA:
+       case OSIOCZIFDATA:
                if (l != NULL) {
                        error = kauth_authorize_network(l->l_cred,
                            KAUTH_NETWORK_INTERFACE,



Home | Main Index | Thread Index | Old Index