2007-08-10 21:35:24

by Johannes Berg

[permalink] [raw]
Subject: [PATCH] hostapd: don't reference ieee80211_msg_sta_not_assoc if it's unused anyway

Hostapd doesn't do anything about such frames. Kernel no longer sends
them and the constant was removed, so let's not reference it any longer.


Signed-off-by: Johannes Berg <[email protected]>

--- hostap.orig/hostapd/driver_devicescape.c 2007-08-10 23:33:19.000000000 +0200
+++ hostap/hostapd/driver_devicescape.c 2007-08-10 23:35:10.000000000 +0200
@@ -1351,9 +1351,12 @@ static void handle_frame(struct hostapd_
}

/* PS-Poll frame from not associated is 16 bytes. All other frames
- * passed to hostapd are 24 bytes or longer. */
- if (len < 24 &&
- (msg_type != ieee80211_msg_sta_not_assoc || len < 16)) {
+ * passed to hostapd are 24 bytes or longer.
+ * Right now, the kernel doesn't send us any frames from not-associated
+ * because the code here doesn't care. TODO: add support to kernel
+ * and send DEAUTH/DISASSOC to them...
+ */
+ if (len < 24) {
printf("handle_frame: too short (%lu), type %d\n",
(unsigned long) len, msg_type);
return;
@@ -1425,9 +1428,15 @@ static void handle_frame(struct hostapd_
case ieee80211_msg_michael_mic_failure:
hostapd_michael_mic_failure(hapd, buf, data_len);
return;
- case ieee80211_msg_sta_not_assoc:
- /* TODO: ieee802_11_rx_sta_not_assoc(hapd, buf, data_len); */
+/*
+ * TODO
+ * We should be telling them to go away. But we don't support that now.
+ * See also below and above for other TODO items related to this.
+
+ case ieee80211_msg_sta_not_assoc:
+ ieee802_11_rx_sta_not_assoc(hapd, buf, data_len);
return;
+ */
default:
printf("handle_frame: unknown msg_type %d\n", msg_type);
return;




2007-08-15 03:41:21

by Jouni Malinen

[permalink] [raw]
Subject: Re: [PATCH] hostapd: don't reference ieee80211_msg_sta_not_assoc if it's unused anyway

On Fri, Aug 10, 2007 at 11:38:01PM +0200, Johannes Berg wrote:
> Hostapd doesn't do anything about such frames. Kernel no longer sends
> them and the constant was removed, so let's not reference it any longer.

This is not good.. We should really make sure that deauth/disassoc is
sent out at proper time to avoid clients getting stuck believing that
they are associated.

Why does the kernel no longer send this notification? The current
wireless-dev.git seems to have this still in use and as such, I have not
applied this change into hostapd and would rather not apply it either,
i.e., if there is some need for getting rid of
ieee80211_msg_sta_not_assoc, I would like to see it being done by
providing similar functionality by some other means, not by just
removing this.

--
Jouni Malinen PGP id EFC895FA

2007-08-15 10:49:15

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] hostapd: don't reference ieee80211_msg_sta_not_assoc if it's unused anyway

On Tue, 2007-08-14 at 20:40 -0700, Jouni Malinen wrote:
> On Fri, Aug 10, 2007 at 11:38:01PM +0200, Johannes Berg wrote:
> > Hostapd doesn't do anything about such frames. Kernel no longer sends
> > them and the constant was removed, so let's not reference it any longer..
>
> This is not good.. We should really make sure that deauth/disassoc is
> sent out at proper time to avoid clients getting stuck believing that
> they are associated.

I know we should, but I regard this as a bit of a chicken and egg
problem. Right now, hostapd doesn't care, but the kernel sends those
notifications. So I could remove it from the kernel without anybody ever
noticing.

> Why does the kernel no longer send this notification? The current
> wireless-dev.git seems to have this still in use and as such, I have not
> applied this change into hostapd and would rather not apply it either,
> i.e., if there is some need for getting rid of
> ieee80211_msg_sta_not_assoc, I would like to see it being done by
> providing similar functionality by some other means, not by just
> removing this.

The reason for removing all the ieee80211_msg_* constants is that I'd
really love to be able to get rid of the prism2 header hack in there. By
removing it from both sides I've only slightly extended the TODO from
"fix this in hostapd" to "add API to the kernel and use it in hostapd"
which I thought appropriate.

johannes


Attachments:
signature.asc (190.00 B)
This is a digitally signed message part

2007-08-16 02:06:08

by Jouni Malinen

[permalink] [raw]
Subject: Re: [PATCH] hostapd: don't reference ieee80211_msg_sta_not_assoc if it's unused anyway

On Wed, Aug 15, 2007 at 12:48:44PM +0200, Johannes Berg wrote:

> The reason for removing all the ieee80211_msg_* constants is that I'd
> really love to be able to get rid of the prism2 header hack in there. By
> removing it from both sides I've only slightly extended the TODO from
> "fix this in hostapd" to "add API to the kernel and use it in hostapd"
> which I thought appropriate.

OK. I applied both this and the ieee80211_msg_key_threshold_notification
changes. I'm not really fond of that extra header hack either, it just
seemed to be only reasonable option at the time. As far the management
interface itself is concerned, I haven't been convinced of its badness,
but anyway, as far as these two notification events are concerned, there
is not much need for providing the full frame to user space and another
API would be perfectly fine for them.

--
Jouni Malinen PGP id EFC895FA