mac80211: add support for userspace to handle auth frames on adhoc ifaces
PATCH 1/1 mac80211: add support for userspace to handle auth frames on adhoc ifaces
Hello all!
This patch allows userspace applications to use nl80211 to register for AUTH frames received on adhoc interfaces.
Thanks,
Will
---
net/mac80211/main.c +3 -1
@@ -455,7 +455,9 @@ static const struct ieee80211_txrx_stypes ieee80211_default_mgmt_stypes[NUM_NL80211_IFTYPES] = { [NL80211_IFTYPE_ADHOC] = { .tx = 0xffff, - .rx = BIT(IEEE80211_STYPE_ACTION >> 4), + .rx =BIT (IEEE80211_STYPE_ACTION >>4 ) | +BIT (IEEE80211_STYPE_AUTH >>4 ) | + BIT(IEEE80211_STYPE_DEAUTH >> 4), }, [NL80211_IFTYPE_STATION] = { .tx = 0xffff,
Johannes Berg
maintainerQuoted 9 lines · Will Hawkins
Hello all!
This patch allows userspace applications to use nl80211 to register for AUTH frames received on adhoc interfaces.
Thanks,
WillSigned-off-by Will Hawkins <[email protected]>
Thanks for the patch. Can I get you to write a better commit log? :-)
You should remove the "Hello" and "Thanks" portions, they shouldn't go into the kernel's commit log after all. And then, even if I already know, please explain in the commit log why you're making this change so the reason gets recorded in the kernel's commit log.
Thanks,
johannes
Quoted 9 lines · Johannes Berg
Quoted 8 lines · Will Hawkins
Hello all!
This patch allows userspace applications to use nl80211 to register for AUTH frames received on adhoc interfaces.
Thanks,
Will
Quoted 8 lines
Quoted 1 line
Signed-off-by Will Hawkins <[email protected]>Thanks for the patch. Can I get you to write a better commit log? :-)
You should remove the "Hello" and "Thanks" portions, they shouldn't go into the kernel's commit log after all. And then, even if I already know, please explain in the commit log why you're making this change so the reason gets recorded in the kernel's commit log.
I submitted a v2 of this patch with a better commit log. Thanks for the handholding. I'm obviously still new at this!
Will
Quoted 10 lines
Thanks,
johannes--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 4 lines · Will Hawkins
Hello all!
This patch allows userspace applications to use nl80211 to register for AUTH frames received on adhoc interfaces.
Hi,
I just have a question here : when auth frames are not delivered to userspace, mac80211 will respond to them, and also uses them to detect node reboot. If you register for auth frames, mac80211 will still send auth frames as soon as a new station is seen, which might be confusing for user space. Is that ok to do this ? Or should userspace have more control over how mac80211 sends auth frames ?
There is also another thing to consider if you want to send auth frames from userspace, as CMD_FRAME requires a frequency, which in IBSS mode, can change anytime without userspace being notified. If you only have to answer to received auth frames, this is easier as you can reuse the frequency given by nl80211 when receiving the auth frame. But if you want to send a auth frame independently, how do you get the frequency to use ?
I ask because i was currently trying to move the node reboot detection from the kernel to userspace, and i currently only fixed these problems by ugly hacks.
Johannes Berg
maintainerQuoted 6 lines · Nicolas Cavallari
I just have a question here : when auth frames are not delivered to userspace, mac80211 will respond to them, and also uses them to detect node reboot. If you register for auth frames, mac80211 will still send auth frames as soon as a new station is seen, which might be confusing for user space. Is that ok to do this ? Or should userspace have more control over how mac80211 sends auth frames ?
Please read the code. If userspace registers for them, mac80211 will never do anything with the frame.
Quoted 7 lines
There is also another thing to consider if you want to send auth frames from userspace, as
CMD_FRAMErequires a frequency, which in IBSS mode, can change anytime without userspace being notified. If you only have to answer to received auth frames, this is easier as you can reuse the frequency given by nl80211 when receiving the auth frame. But if you want to send a auth frame independently, how do you get the frequency to use ?
You check the BSS info, that's trivial.
johannes
Quoted 11 lines · Johannes Berg
Quoted 6 lines · Nicolas Cavallari
I just have a question here : when auth frames are not delivered to userspace, mac80211 will respond to them, and also uses them to detect node reboot. If you register for auth frames, mac80211 will still send auth frames as soon as a new station is seen, which might be confusing for user space. Is that ok to do this ? Or should userspace have more control over how mac80211 sends auth frames ?
Please read the code. If userspace registers for them, mac80211 will never do anything with the frame.
I didn't say the contrary. But if you read ieee80211_ibss_finish_sta(), you see that mac80211 sends auth frames to each discovered station, even if userspace want to handle auth frames. This seems strange to be able to receive and handle auth frames from userspace while mac80211 sends them behind userspace's back.
Quoted 10 lines
Quoted 8 lines
There is also another thing to consider if you want to send auth frames from userspace, as
CMD_FRAMErequires a frequency, which in IBSS mode, can change anytime without userspace being notified. If you only have to answer to received auth frames, this is easier as you can reuse the frequency given by nl80211 when receiving the auth frame. But if you want to send a auth frame independently, how do you get the frequency to use ?You check the BSS info, that's trivial.
There is no GET_BSS from userspace. when merging IBSS, only the new BSSID is notified. The only way to get this info from userspace would be to dump the scan result and check the "we joined that ibss" flag, and this isn't race-free. That, or using fixed_freq.
Quoted 28 lines · Nicolas Cavallari
Quoted 11 lines · Johannes Berg
Quoted 6 lines · Nicolas Cavallari
I just have a question here : when auth frames are not delivered to userspace, mac80211 will respond to them, and also uses them to detect node reboot. If you register for auth frames, mac80211 will still send auth frames as soon as a new station is seen, which might be confusing for user space. Is that ok to do this ? Or should userspace have more control over how mac80211 sends auth frames ?
Please read the code. If userspace registers for them, mac80211 will never do anything with the frame.
I didn't say the contrary. But if you read
ieee80211_ibss_finish_sta(), you see that mac80211 sends auth frames to each discovered station, even if userspace want to handle auth frames. This seems strange to be able to receive and handle auth frames from userspace while mac80211 sends them behind userspace's back.Quoted 9 lines
Quoted 8 lines
There is also another thing to consider if you want to send auth frames from userspace, as
CMD_FRAMErequires a frequency, which in IBSS mode, can change anytime without userspace being notified. If you only have to answer to received auth frames, this is easier as you can reuse the frequency given by nl80211 when receiving the auth frame. But if you want to send a auth frame independently, how do you get the frequency to use ?
Quoted 7 lines
Quoted 1 line
You check the BSS info, that's trivial.
There is no
GET_BSSfrom userspace. when merging IBSS, only the new BSSID is notified. The only way to get this info from userspace would be to dump the scan result and check the "we joined that ibss" flag, and this isn't race-free. That, or usingfixed_freq.
I've only coded for situations where I am joined to an ibss with a fixed_freq so I've never encountered this problem.
Will
Johannes Berg
maintainerQuoted 10 lines · Nicolas Cavallari
Quoted 9 lines · Johannes Berg
Quoted 6 lines · Nicolas Cavallari
I just have a question here : when auth frames are not delivered to userspace, mac80211 will respond to them, and also uses them to detect node reboot. If you register for auth frames, mac80211 will still send auth frames as soon as a new station is seen, which might be confusing for user space. Is that ok to do this ? Or should userspace have more control over how mac80211 sends auth frames ?
Quoted 8 lines
Quoted 2 lines
Please read the code. If userspace registers for them, mac80211 will never do anything with the frame.
I didn't say the contrary. But if you read
ieee80211_ibss_finish_sta(), you see that mac80211 sends auth frames to each discovered station, even if userspace want to handle auth frames. This seems strange to be able to receive and handle auth frames from userspace while mac80211 sends them behind userspace's back.
Oops, sorry, yes. I forgot all about that code!
I suppose we'd have to check whether userspace is handling authentication?
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
There is also another thing to consider if you want to send auth frames from userspace, as
CMD_FRAMErequires a frequency, which in IBSS mode, can change anytime without userspace being notified. If you only have to answer to received auth frames, this is easier as you can reuse the frequency given by nl80211 when receiving the auth frame. But if you want to send a auth frame independently, how do you get the frequency to use ?
Quoted 6 lines
Quoted 1 line
You check the BSS info, that's trivial.
There is no
GET_BSSfrom userspace. when merging IBSS, only the new BSSID is notified. The only way to get this info from userspace would be to dump the scan result and check the "we joined that ibss" flag, and this isn't race-free. That, or usingfixed_freq.
Yeah, I guess that's true -- we should probably just allow not giving a frequency attribute at all and then it only works if you're connected/... but uses the right frequency.
johannes
Quoted 20 lines · Johannes Berg
Quoted 10 lines · Nicolas Cavallari
Quoted 9 lines · Johannes Berg
Quoted 6 lines · Nicolas Cavallari
I just have a question here : when auth frames are not delivered to userspace, mac80211 will respond to them, and also uses them to detect node reboot. If you register for auth frames, mac80211 will still send auth frames as soon as a new station is seen, which might be confusing for user space. Is that ok to do this ? Or should userspace have more control over how mac80211 sends auth frames ?
Quoted 8 lines
Quoted 2 lines
Please read the code. If userspace registers for them, mac80211 will never do anything with the frame.
I didn't say the contrary. But if you read
ieee80211_ibss_finish_sta(), you see that mac80211 sends auth frames to each discovered station, even if userspace want to handle auth frames. This seems strange to be able to receive and handle auth frames from userspace while mac80211 sends them behind userspace's back.
Quoted 4 lines
Oops, sorry, yes. I forgot all about that code!
I suppose we'd have to check whether userspace is handling authentication?
Could use the control_port flag to check for that condition?
Quoted 23 lines
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines
There is also another thing to consider if you want to send auth frames from userspace, as
CMD_FRAMErequires a frequency, which in IBSS mode, can change anytime without userspace being notified. If you only have to answer to received auth frames, this is easier as you can reuse the frequency given by nl80211 when receiving the auth frame. But if you want to send a auth frame independently, how do you get the frequency to use ?Quoted 6 lines
Quoted 1 line
You check the BSS info, that's trivial.
There is no
GET_BSSfrom userspace. when merging IBSS, only the new BSSID is notified. The only way to get this info from userspace would be to dump the scan result and check the "we joined that ibss" flag, and this isn't race-free. That, or usingfixed_freq.Yeah, I guess that's true -- we should probably just allow not giving a frequency attribute at all and then it only works if you're connected/... but uses the right frequency.
johannes
Johannes Berg
maintainerQuoted 22 lines · Will Hawkins
Quoted 20 lines · Johannes Berg
Quoted 18 lines · Nicolas Cavallari
Quoted 11 lines · Johannes Berg
Quoted 6 lines · Nicolas Cavallari
I just have a question here : when auth frames are not delivered to userspace, mac80211 will respond to them, and also uses them to detect node reboot. If you register for auth frames, mac80211 will still send auth frames as soon as a new station is seen, which might be confusing for user space. Is that ok to do this ? Or should userspace have more control over how mac80211 sends auth frames ?
Please read the code. If userspace registers for them, mac80211 will never do anything with the frame.
I didn't say the contrary. But if you read
ieee80211_ibss_finish_sta(), you see that mac80211 sends auth frames to each discovered station, even if userspace want to handle auth frames. This seems strange to be able to receive and handle auth frames from userspace while mac80211 sends them behind userspace's back.
Quoted 6 lines
Quoted 4 lines
Oops, sorry, yes. I forgot all about that code!
I suppose we'd have to check whether userspace is handling authentication?
Could use the
control_portflag to check for that condition?
Not really, that's not necessarily the same thing -- I think we might want to also allow to offload open auth to userspace.
I think it wouldn't be difficult to notify mac80211 about frame registrations so it can keep track for this purpose?
johannes
Quoted 30 lines · Johannes Berg
Quoted 22 lines · Will Hawkins
Quoted 20 lines · Johannes Berg
Quoted 18 lines · Nicolas Cavallari
Quoted 11 lines · Johannes Berg
Quoted 6 lines · Nicolas Cavallari
I just have a question here : when auth frames are not delivered to userspace, mac80211 will respond to them, and also uses them to detect node reboot. If you register for auth frames, mac80211 will still send auth frames as soon as a new station is seen, which might be confusing for user space. Is that ok to do this ? Or should userspace have more control over how mac80211 sends auth frames ?
Please read the code. If userspace registers for them, mac80211 will never do anything with the frame.
I didn't say the contrary. But if you read
ieee80211_ibss_finish_sta(), you see that mac80211 sends auth frames to each discovered station, even if userspace want to handle auth frames. This seems strange to be able to receive and handle auth frames from userspace while mac80211 sends them behind userspace's back.Quoted 6 lines
Quoted 4 lines
Oops, sorry, yes. I forgot all about that code!
I suppose we'd have to check whether userspace is handling authentication?
Could use the
control_portflag to check for that condition?
Quoted 7 lines
Not really, that's not necessarily the same thing -- I think we might want to also allow to offload open auth to userspace.
I think it wouldn't be difficult to notify mac80211 about frame registrations so it can keep track for this purpose?
johannes
I am happy to code something like this up. I've already taken a look at it and don't think it will be too big of a problem. I am going to be AFK until Monday so I won't get to it until then. I hope that's not a problem.
Will
Quoted 6 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Johannes Berg
maintainerQuoted 11 lines
Quoted 11 lines
Quoted 7 lines
Quoted 5 lines
Oops, sorry, yes. I forgot all about that code!
I suppose we'd have to check whether userspace is handling authentication?
Could use the
control_portflag to check for that condition?Not really, that's not necessarily the same thing -- I think we might want to also allow to offload open auth to userspace.
Quoted 8 lines
Quoted 4 lines
I think it wouldn't be difficult to notify mac80211 about frame registrations so it can keep track for this purpose?
johannes
I am happy to code something like this up. I've already taken a look at it and don't think it will be too big of a problem. I am going to be AFK until Monday so I won't get to it until then. I hope that's not a problem.
No problem, take your time! I'm not in any hurry with this feature :-)
johannes