summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzhuk <zhuk@openbsd.org>2014-08-24 18:01:27 +0000
committerzhuk <zhuk@openbsd.org>2014-08-24 18:01:27 +0000
commitcfe90bb7c292585e6ed2549277afb2dd7b4e76b4 (patch)
treeb88d6322015f37414b0b247fa04acf888960b5ec
parentremove trailing whitespace (diff)
downloadwireguard-openbsd-cfe90bb7c292585e6ed2549277afb2dd7b4e76b4.tar.xz
wireguard-openbsd-cfe90bb7c292585e6ed2549277afb2dd7b4e76b4.zip
Fix wrong IEEE 802.11 ioctl's:
* SIOCG80211ALLNODES operates on struct ieee80211_nodereq_all, not struct ieee80211_nodereq. * Six SIOC* from wi(4) were using same codes with generic parts of IEEE 802.11 framework. Things worked due to the fact that size of data struct being passed is encoded in actual SIOC*, too. This commit means that ifconfig and some ports will need to be rebuilt, if any of affected SIOC* codes is used. Port bumps to follow. First part okay reyk@, whole diff okay mpi@ Heavy prodding to commit now from deraadt@
-rw-r--r--sys/dev/ic/if_wi_hostap.h14
-rw-r--r--sys/dev/ic/if_wi_ieee.h6
-rw-r--r--sys/net80211/ieee80211_ioctl.h4
3 files changed, 12 insertions, 12 deletions
diff --git a/sys/dev/ic/if_wi_hostap.h b/sys/dev/ic/if_wi_hostap.h
index c12825be3a6..f30754e5eee 100644
--- a/sys/dev/ic/if_wi_hostap.h
+++ b/sys/dev/ic/if_wi_hostap.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi_hostap.h,v 1.9 2003/10/21 18:58:49 jmc Exp $ */
+/* $OpenBSD: if_wi_hostap.h,v 1.10 2014/08/24 18:01:27 zhuk Exp $ */
/*
* Copyright (c) 2002
@@ -53,12 +53,12 @@ struct hostap_sta {
#define HOSTAP_FLAGS_PERM 0x0004
#define HOSTAP_FLAGS_BITS "\20\01AUTH\02ASSOC\03PERM"
-#define SIOCHOSTAP_GET _IOWR('i', 210, struct ifreq)
-#define SIOCHOSTAP_ADD _IOWR('i', 211, struct ifreq)
-#define SIOCHOSTAP_DEL _IOWR('i', 212, struct ifreq)
-#define SIOCHOSTAP_GETALL _IOWR('i', 213, struct ifreq)
-#define SIOCHOSTAP_GFLAGS _IOWR('i', 214, struct ifreq)
-#define SIOCHOSTAP_SFLAGS _IOWR('i', 215, struct ifreq)
+#define SIOCHOSTAP_GET _IOWR('i', 200, struct ifreq)
+#define SIOCHOSTAP_ADD _IOWR('i', 201, struct ifreq)
+#define SIOCHOSTAP_DEL _IOWR('i', 202, struct ifreq)
+#define SIOCHOSTAP_GETALL _IOWR('i', 203, struct ifreq)
+#define SIOCHOSTAP_GFLAGS _IOWR('i', 204, struct ifreq)
+#define SIOCHOSTAP_SFLAGS _IOWR('i', 205, struct ifreq)
/* Flags for SIOCHOSTAP_GFLAGS/SFLAGS */
#define WIHAPFL_ACTIVE 0x0001
diff --git a/sys/dev/ic/if_wi_ieee.h b/sys/dev/ic/if_wi_ieee.h
index 140e1577235..c47e5bdac62 100644
--- a/sys/dev/ic/if_wi_ieee.h
+++ b/sys/dev/ic/if_wi_ieee.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi_ieee.h,v 1.29 2006/06/27 20:55:51 reyk Exp $ */
+/* $OpenBSD: if_wi_ieee.h,v 1.30 2014/08/24 18:01:27 zhuk Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -45,8 +45,8 @@
* interface, didn't I.
*/
-#define SIOCSWAVELAN _IOW('i', 249, struct ifreq) /* wavelan set op */
-#define SIOCGWAVELAN _IOWR('i', 250, struct ifreq) /* wavelan get op */
+#define SIOCSWAVELAN _IOW('i', 206, struct ifreq) /* wavelan set op */
+#define SIOCGWAVELAN _IOWR('i', 207, struct ifreq) /* wavelan get op */
/*
* Technically I don't think there's a limit to a record
diff --git a/sys/net80211/ieee80211_ioctl.h b/sys/net80211/ieee80211_ioctl.h
index c1577694ed4..e408da7c0cc 100644
--- a/sys/net80211/ieee80211_ioctl.h
+++ b/sys/net80211/ieee80211_ioctl.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_ioctl.h,v 1.19 2014/07/10 14:32:28 stsp Exp $ */
+/* $OpenBSD: ieee80211_ioctl.h,v 1.20 2014/08/24 18:01:27 zhuk Exp $ */
/* $NetBSD: ieee80211_ioctl.h,v 1.7 2004/04/30 22:51:04 dyoung Exp $ */
/*-
@@ -348,7 +348,7 @@ struct ieee80211_nodereq_all {
u_int8_t na_flags; /* IEEE80211_NODEREQ_* */
};
-#define SIOCG80211ALLNODES _IOWR('i', 214, struct ieee80211_nodereq)
+#define SIOCG80211ALLNODES _IOWR('i', 214, struct ieee80211_nodereq_all)
/* net80211 specific interface flags */
#define IEEE80211_F_HIDENWID 0x10000000 /* CONF: hidden ssid mode */