Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/compat/common can't map the old and the new SIO calls th...
details: https://anonhg.NetBSD.org/src/rev/03c5c867a944
branches: trunk
changeset: 758515:03c5c867a944
user: christos <christos%NetBSD.org@localhost>
date: Sat Nov 06 17:20:07 2010 +0000
description:
can't map the old and the new SIO calls the way we did before because the
numbers have changed. Instead provide a switch. Keep the old code there,
to handle cases we did not handle in the first switch, but this is a hack
and should be removed.
diffstat:
sys/compat/common/if_43.c | 196 ++++++++++++++++++++++++++++-----------------
1 files changed, 123 insertions(+), 73 deletions(-)
diffs (220 lines):
diff -r dc93c3188f9c -r 03c5c867a944 sys/compat/common/if_43.c
--- a/sys/compat/common/if_43.c Sat Nov 06 17:17:13 2010 +0000
+++ b/sys/compat/common/if_43.c Sat Nov 06 17:20:07 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_43.c,v 1.2 2009/03/17 00:08:10 dyoung Exp $ */
+/* $NetBSD: if_43.c,v 1.3 2010/11/06 17:20:07 christos Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1990, 1993
@@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_43.c,v 1.2 2009/03/17 00:08:10 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_43.c,v 1.3 2010/11/06 17:20:07 christos Exp $");
#if defined(_KERNEL_OPT)
#include "opt_compat_netbsd.h"
@@ -86,80 +86,130 @@
if (IOCPARM_LEN(cmd) != sizeof(struct oifreq))
return cmd;
- ncmd = ((cmd) & ~(IOCPARM_MASK << IOCPARM_SHIFT)) |
- (sizeof(struct ifreq) << IOCPARM_SHIFT);
-
- switch (ncmd) {
- case BIOCGETIF:
- case BIOCSETIF:
- case GREDSOCK:
- case GREGADDRD:
- case GREGADDRS:
- case GREGPROTO:
- case GRESADDRD:
- case GRESADDRS:
- case GRESPROTO:
- case GRESSOCK:
+ switch (cmd) {
+ case OSIOCSIFADDR:
+ return SIOCSIFADDR;
+ case OOSIOCGIFADDR:
+ return SIOCGIFADDR;
+ case OSIOCSIFDSTADDR:
+ return SIOCSIFDSTADDR;
+ case OOSIOCGIFDSTADDR:
+ return SIOCGIFDSTADDR;
+ case OSIOCSIFFLAGS:
+ return SIOCSIFFLAGS;
+ case OSIOCGIFFLAGS:
+ return SIOCGIFFLAGS;
+ case OOSIOCGIFBRDADDR:
+ return SIOCGIFBRDADDR;
+ case OSIOCSIFBRDADDR:
+ return SIOCSIFBRDADDR;
+ case OOSIOCGIFCONF:
+ return SIOCGIFCONF;
+ case OOSIOCGIFNETMASK:
+ return SIOCGIFNETMASK;
+ case OSIOCSIFNETMASK:
+ return SIOCSIFNETMASK;
+ case OSIOCGIFCONF:
+ return SIOCGIFCONF;
+ case OSIOCADDMULTI:
+ return SIOCADDMULTI;
+ case OSIOCDELMULTI:
+ return SIOCDELMULTI;
+ case OSIOCSIFMEDIA:
+ return SIOCSIFMEDIA;
+ case OSIOCGIFMTU:
+ return SIOCGIFMTU;
+ case OSIOCGIFDATA:
+ return SIOCGIFDATA;
+ case OSIOCZIFDATA:
+ return SIOCZIFDATA;
+ case OBIOCGETIF:
+ return BIOCGETIF;
+ case OBIOCSETIF:
+ return BIOCSETIF;
+ case OTAPGIFNAME:
+ return TAPGIFNAME;
+ default:
+ /*
+ * XXX: the following code should be removed and the
+ * needing treatment ioctls should move to the switch
+ * above.
+ */
+ ncmd = ((cmd) & ~(IOCPARM_MASK << IOCPARM_SHIFT)) |
+ (sizeof(struct ifreq) << IOCPARM_SHIFT);
+ switch (ncmd) {
+ case BIOCGETIF:
+ case BIOCSETIF:
+ case GREDSOCK:
+ case GREGADDRD:
+ case GREGADDRS:
+ case GREGPROTO:
+ case GRESADDRD:
+ case GRESADDRS:
+ case GRESPROTO:
+ case GRESSOCK:
#ifdef COMPAT_20
- case OSIOCG80211STATS:
- case OSIOCG80211ZSTATS:
+ case OSIOCG80211STATS:
+ case OSIOCG80211ZSTATS:
#endif /* COMPAT_20 */
- case SIOCADDMULTI:
- case SIOCDELMULTI:
- case SIOCDIFADDR:
- case SIOCDIFADDR_IN6:
- case SIOCDIFPHYADDR:
- case SIOCGDEFIFACE_IN6:
- case SIOCG80211NWID:
- case SIOCG80211STATS:
- case SIOCG80211ZSTATS:
- case SIOCGIFADDR:
- case SIOCGIFADDR_IN6:
- case SIOCGIFAFLAG_IN6:
- case SIOCGIFALIFETIME_IN6:
- case SIOCGIFBRDADDR:
- case SIOCGIFDLT:
- case SIOCGIFDSTADDR:
- case SIOCGIFDSTADDR_IN6:
- case SIOCGIFFLAGS:
- case SIOCGIFGENERIC:
- case SIOCGIFMETRIC:
- case SIOCGIFMTU:
- case SIOCGIFNETMASK:
- case SIOCGIFNETMASK_IN6:
- case SIOCGIFPDSTADDR:
- case SIOCGIFPDSTADDR_IN6:
- case SIOCGIFPSRCADDR:
- case SIOCGIFPSRCADDR_IN6:
- case SIOCGIFSTAT_ICMP6:
- case SIOCGIFSTAT_IN6:
- case SIOCGPVCSIF:
- case SIOCGVH:
- case SIOCIFCREATE:
- case SIOCIFDESTROY:
- case SIOCS80211NWID:
- case SIOCSDEFIFACE_IN6:
- case SIOCSIFADDR:
- case SIOCSIFADDR_IN6:
- case SIOCSIFBRDADDR:
- case SIOCSIFDSTADDR:
- case SIOCSIFDSTADDR_IN6:
- case SIOCSIFFLAGS:
- case SIOCSIFGENERIC:
- case SIOCSIFMEDIA:
- case SIOCSIFMETRIC:
- case SIOCSIFMTU:
- case SIOCSIFNETMASK:
- case SIOCSIFNETMASK_IN6:
- case SIOCSNDFLUSH_IN6:
- case SIOCSPFXFLUSH_IN6:
- case SIOCSPVCSIF:
- case SIOCSRTRFLUSH_IN6:
- case SIOCSVH:
- case TAPGIFNAME:
- return ncmd;
+ case SIOCADDMULTI:
+ case SIOCDELMULTI:
+ case SIOCDIFADDR:
+ case SIOCDIFADDR_IN6:
+ case SIOCDIFPHYADDR:
+ case SIOCGDEFIFACE_IN6:
+ case SIOCG80211NWID:
+ case SIOCG80211STATS:
+ case SIOCG80211ZSTATS:
+ case SIOCGIFADDR:
+ case SIOCGIFADDR_IN6:
+ case SIOCGIFAFLAG_IN6:
+ case SIOCGIFALIFETIME_IN6:
+ case SIOCGIFBRDADDR:
+ case SIOCGIFDLT:
+ case SIOCGIFDSTADDR:
+ case SIOCGIFDSTADDR_IN6:
+ case SIOCGIFFLAGS:
+ case SIOCGIFGENERIC:
+ case SIOCGIFMETRIC:
+ case SIOCGIFMTU:
+ case SIOCGIFNETMASK:
+ case SIOCGIFNETMASK_IN6:
+ case SIOCGIFPDSTADDR:
+ case SIOCGIFPDSTADDR_IN6:
+ case SIOCGIFPSRCADDR:
+ case SIOCGIFPSRCADDR_IN6:
+ case SIOCGIFSTAT_ICMP6:
+ case SIOCGIFSTAT_IN6:
+ case SIOCGPVCSIF:
+ case SIOCGVH:
+ case SIOCIFCREATE:
+ case SIOCIFDESTROY:
+ case SIOCS80211NWID:
+ case SIOCSDEFIFACE_IN6:
+ case SIOCSIFADDR:
+ case SIOCSIFADDR_IN6:
+ case SIOCSIFBRDADDR:
+ case SIOCSIFDSTADDR:
+ case SIOCSIFDSTADDR_IN6:
+ case SIOCSIFFLAGS:
+ case SIOCSIFGENERIC:
+ case SIOCSIFMEDIA:
+ case SIOCSIFMETRIC:
+ case SIOCSIFMTU:
+ case SIOCSIFNETMASK:
+ case SIOCSIFNETMASK_IN6:
+ case SIOCSNDFLUSH_IN6:
+ case SIOCSPFXFLUSH_IN6:
+ case SIOCSPVCSIF:
+ case SIOCSRTRFLUSH_IN6:
+ case SIOCSVH:
+ case TAPGIFNAME:
+ return ncmd;
+ default:
+ return cmd;
+ }
}
- return cmd;
}
int
Home |
Main Index |
Thread Index |
Old Index