summaryrefslogtreecommitdiff
path: root/usr.sbin/hostapd
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2005-12-01 02:03:59 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2005-12-01 02:03:59 +0000
commit7777fa4686ac8837e210b415f1dadce7f056d724 (patch)
treee8837094ab1b388207e886cd71f9fae17ac0410f /usr.sbin/hostapd
parent7a1e1bab720a2f7ab5b7684f0df13dacc6651cc2 (diff)
add configuration option to enable/disable specified iapp subtype handling
Diffstat (limited to 'usr.sbin/hostapd')
-rw-r--r--usr.sbin/hostapd/hostapd.conf.529
-rw-r--r--usr.sbin/hostapd/hostapd.h8
-rw-r--r--usr.sbin/hostapd/iapp.c8
-rw-r--r--usr.sbin/hostapd/parse.y36
4 files changed, 74 insertions, 7 deletions
diff --git a/usr.sbin/hostapd/hostapd.conf.5 b/usr.sbin/hostapd/hostapd.conf.5
index c10749b0c98..cd69140e43d 100644
--- a/usr.sbin/hostapd/hostapd.conf.5
+++ b/usr.sbin/hostapd/hostapd.conf.5
@@ -1,4 +1,4 @@
-.\" $OpenBSD: hostapd.conf.5,v 1.22 2005/12/01 01:28:19 reyk Exp $
+5~.\" $OpenBSD: hostapd.conf.5,v 1.23 2005/12/01 02:03:57 reyk Exp $
.\"
.\" Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net>
.\"
@@ -65,6 +65,7 @@ Macros are not expanded inside quotes.
For example:
.Bd -literal -offset indent
wlan="ath0"
+set iapp handle subtype { ! add notify, radiotap }
set iapp interface $wlan
.Ed
.Sh TABLES
@@ -138,6 +139,32 @@ Specify the mandatory Inter-Access-Point (IAPP) interface.
It is important that the IAPP interface is on a trusted
network because there is no authentication and an attacker could force
disassociation of selected stations on all listening access points.
+.It Xo
+.Ic set iapp handle subtype
+.Ar subtype \*(Ba\ \&
+.Pf { Ar subtype0 , subtype1 , ... No }
+.Xc
+Specify the IAPP subtypes to use:
+.Pp
+.Bl -tag -width broadcast -offset indent -compact
+.It Xo
+.Op Ic not
+.Ic add notify
+.Xc
+Sent and receive
+.Em ADD.notify
+messages.
+This option is enabled by default.
+.It Xo
+.Op Ic not
+.Ic radiotap
+.Xc
+Receive
+.Em radiotap
+messages.
+This option is enabled by default.
+.El
+.Pp
.It Ic set iapp mode Ar mode
Specify the IAPP mode.
The supported modes are:
diff --git a/usr.sbin/hostapd/hostapd.h b/usr.sbin/hostapd/hostapd.h
index f386bcc47cd..89191156a4f 100644
--- a/usr.sbin/hostapd/hostapd.h
+++ b/usr.sbin/hostapd/hostapd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: hostapd.h,v 1.13 2005/12/01 01:28:19 reyk Exp $ */
+/* $OpenBSD: hostapd.h,v 1.14 2005/12/01 02:03:58 reyk Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net>
@@ -263,6 +263,12 @@ struct hostapd_iapp {
struct sockaddr_in i_addr;
struct sockaddr_in i_broadcast;
struct sockaddr_in i_multicast;
+ u_int8_t i_flags;
+
+#define HOSTAPD_IAPP_F_ADD_NOTIFY 0x01
+#define HOSTAPD_IAPP_F_RADIOTAP 0x02
+#define HOSTAPD_IAPP_F_DEFAULT \
+ (HOSTAPD_IAPP_F_ADD_NOTIFY | HOSTAPD_IAPP_F_RADIOTAP)
};
struct hostapd_config {
diff --git a/usr.sbin/hostapd/iapp.c b/usr.sbin/hostapd/iapp.c
index 0c723cc1123..acdd9c8e04e 100644
--- a/usr.sbin/hostapd/iapp.c
+++ b/usr.sbin/hostapd/iapp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iapp.c,v 1.12 2005/12/01 01:11:30 reyk Exp $ */
+/* $OpenBSD: iapp.c,v 1.13 2005/12/01 02:03:58 reyk Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net>
@@ -91,6 +91,9 @@ hostapd_iapp_add_notify(struct hostapd_apme *apme, struct hostapd_node *node)
struct ieee80211_iapp_add_notify add;
} __packed frame;
+ if ((iapp->i_flags & HOSTAPD_IAPP_F_ADD_NOTIFY) == 0)
+ return (0);
+
/*
* Send an ADD.notify message to other accesspoints to notify
* about a new association on our Host AP.
@@ -274,6 +277,9 @@ hostapd_iapp_input(int fd, short sig, void *arg)
case IEEE80211_IAPP_FRAME_HOSTAPD_PCAP:
case IEEE80211_IAPP_FRAME_HOSTAPD_RADIOTAP:
+ if ((iapp->i_flags & HOSTAPD_IAPP_F_RADIOTAP) == 0)
+ return;
+
/* Short frame */
if (len <= (ssize_t)sizeof(struct ieee80211_iapp_frame) ||
frame->hdr.i_length < sizeof(struct ieee80211_frame))
diff --git a/usr.sbin/hostapd/parse.y b/usr.sbin/hostapd/parse.y
index 179d1172bb2..0220e6aac19 100644
--- a/usr.sbin/hostapd/parse.y
+++ b/usr.sbin/hostapd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.16 2005/12/01 01:28:19 reyk Exp $ */
+/* $OpenBSD: parse.y,v 1.17 2005/12/01 02:03:58 reyk Exp $ */
/*
* Copyright (c) 2004, 2005 Reyk Floeter <reyk@vantronix.net>
@@ -107,12 +107,16 @@ u_int negative;
#define HOSTAPD_MATCH(_m) { \
frame.f_flags |= negative ? \
HOSTAPD_FRAME_F_##_m##_N : HOSTAPD_FRAME_F_##_m; \
- negative = 0; \
}
#define HOSTAPD_MATCH_TABLE(_m) { \
frame.f_flags |= HOSTAPD_FRAME_F_##_m##_TABLE | (negative ? \
HOSTAPD_FRAME_F_##_m##_N : HOSTAPD_FRAME_F_##_m); \
- negative = 0; \
+}
+#define HOSTAPD_IAPP_FLAG(_f) { \
+ if (negative) \
+ hostapd_cfg.c_iapp.i_flags &= ~(HOSTAPD_IAPP_F_##_f); \
+ else \
+ hostapd_cfg.c_iapp.i_flags |= (HOSTAPD_IAPP_F_##_f); \
}
%}
@@ -123,7 +127,7 @@ u_int negative;
%token ERROR CONST TABLE NODE DELETE ADD LOG VERBOSE LIMIT QUICK SKIP
%token REASON UNSPECIFIED EXPIRE LEAVE ASSOC TOOMANY NOT AUTHED ASSOCED
%token RESERVED RSN REQUIRED INCONSISTENT IE INVALID MIC FAILURE OPEN
-%token ADDRESS PORT ON
+%token ADDRESS PORT ON NOTIFY
%token <v.string> STRING
%token <v.val> VALUE
%type <v.val> number
@@ -168,6 +172,7 @@ option : SET HOSTAP INTERFACE hostapifaces
free($4);
}
| SET IAPP MODE iappmode
+ | SET IAPP HANDLE SUBTYPE iappsubtypes
;
iappmode : MULTICAST iappmodeaddr iappmodeport
@@ -262,6 +267,24 @@ event : HOSTAP HANDLE
}
;
+iappsubtypes : '{' optnl iappsubtypelist optnl '}'
+ | iappsubtype
+ ;
+
+iappsubtypelist : iappsubtype
+ | iappsubtypelist comma iappsubtype
+ ;
+
+iappsubtype : not ADD NOTIFY
+ {
+ HOSTAPD_IAPP_FLAG(ADD_NOTIFY);
+ }
+ | not RADIOTAP
+ {
+ HOSTAPD_IAPP_FLAG(RADIOTAP);
+ }
+ ;
+
eventopt : /* empty */
{
frame.f_flags |= HOSTAPD_FRAME_F_RET_OK;
@@ -902,6 +925,9 @@ optnl : /* empty */
;
not : /* empty */
+ {
+ negative = 0;
+ }
| '!'
{
negative = 1;
@@ -973,6 +999,7 @@ lookup(char *token)
{ "no", NO },
{ "node", NODE },
{ "not", NOT },
+ { "notify", NOTIFY },
{ "nwid", NWID },
{ "on", ON },
{ "open", OPEN },
@@ -1299,6 +1326,7 @@ hostapd_parse_file(struct hostapd_config *cfg)
TAILQ_INIT(&cfg->c_tables);
TAILQ_INIT(&cfg->c_frames);
cfg->c_iapp.i_multicast.sin_addr.s_addr = INADDR_ANY;
+ cfg->c_iapp.i_flags = HOSTAPD_IAPP_F_DEFAULT;
lineno = 1;
errors = 0;