OpenBSD CVS

CVS log for src/sys/net80211/ieee80211_output.c


[BACK] Up to [local] / src / sys / net80211

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.139 / (download) - annotate - [select for diffs], Wed May 8 14:02:59 2024 UTC (4 weeks, 5 days ago) by stsp
Branch: MAIN
CVS Tags: HEAD
Changes since 1.138: +4 -1 lines
Diff to previous 1.138 (colored)

disable the regular ieee80211_encap() Tx path in monitor mode

Frames injected from user space carry the DLT_IEEE802_11_RADIO
mbuf tag, and are handled as a special case. Do not fall back
to regular encapsulation while we are in monitor mode and the
frame injected by userspace is found to be invalid.

This fixes an issue when iwx(4) runs in monitor mode with addresses
configured on the interface and leaving 11n/11ac mode directly for
monitor mode. In this case, traffic generated by userspace or the
kernel (such as ICMPv6) would trigger Tx attempts, which in turn
would trigger an attempt to set up a block ACK agreement and then
cause a firmware panic.

This points at a related issue where interface configuration state
is not properly cleaned up while switching into monitor mode.
The 11n/11ac interface config should ideally be cleared completely,
preventing block ack from being initiated.

But preventing the stack from trying to send frames down the regular
Tx path in monitor mode is a good idea in general because drivers may
not handle this very well for various reasons, block ack being just one.

tested by jmc@ and myself on iwx ax200

Revision 1.138 / (download) - annotate - [select for diffs], Sun Apr 14 03:26:25 2024 UTC (8 weeks, 2 days ago) by jsg
Branch: MAIN
Changes since 1.137: +5 -3 lines
Diff to previous 1.137 (colored)

with empty body loops, put final semicolon on a new line for readability
ok bluhm@ jca@

Revision 1.137 / (download) - annotate - [select for diffs], Mon Mar 14 15:07:24 2022 UTC (2 years, 2 months ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1
Changes since 1.136: +37 -3 lines
Diff to previous 1.136 (colored)

Add initial 802.11ac (VHT) support to net80211.

Add VHT capability and operation IE definitions to ieee80211.h.
Introduce channel flags to identify 80MHz and 160MHz capable channels.

Parse VHT IEs in beacons, announce the driver's VHT capabilities in
probe requests and assoc requests, and hop into 11ac mode after
association to the AP if possible.

Enable VHT by default if the driver announces support for it.

ok claudio@

Revision 1.136 / (download) - annotate - [select for diffs], Wed Jan 5 05:18:25 2022 UTC (2 years, 5 months ago) by dlg
Branch: MAIN
Changes since 1.135: +3 -3 lines
Diff to previous 1.135 (colored)

rename ETHERTYPE_PAE to ETHERTYPE_EAPOL.

everyone else seems to use ETHERTYPE_EAPOL, and as a bonus it also
appears to be more correct.

ok deraadt@ stsp@

Revision 1.135 / (download) - annotate - [select for diffs], Wed Sep 8 11:40:30 2021 UTC (2 years, 9 months ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.134: +24 -6 lines
Diff to previous 1.134 (colored)

Improve debug output when sending 802.11 action frames by showing the
action frame subtypes we care about (i.e. those related to 11n block ack).

ok mpi@

Revision 1.134 / (download) - annotate - [select for diffs], Tue May 11 08:39:32 2021 UTC (3 years, 1 month ago) by stsp
Branch: MAIN
Changes since 1.133: +9 -1 lines
Diff to previous 1.133 (colored)

In hostap mode don't send data frames to nodes which aren't in state ASSOC.

Sending data frames to nodes in other states is wrong since the node's
data structure might not be set up properly in such states.
This could explain occasional "key unset for sw crypto" panics observed
with athn(4) hostap interfaces.

Problem reported and fix tested by Mikolaj Kucharski.

Revision 1.133 / (download) - annotate - [select for diffs], Wed Mar 10 10:21:48 2021 UTC (3 years, 3 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.132: +3 -3 lines
Diff to previous 1.132 (colored)

spelling

ok gnezdo@ semarie@ mpi@

Revision 1.132 / (download) - annotate - [select for diffs], Tue Dec 8 15:52:04 2020 UTC (3 years, 6 months ago) by stsp
Branch: MAIN
Changes since 1.131: +12 -3 lines
Diff to previous 1.131 (colored)

Fix 802.11 RSN capabilities announced to peers.

We were echoing back all RSN capabilities announced by our peer, even
for features which we don't support.
One such feature is Management Frame Protection (MFP). If we announce this
capability then the peer sends us encrypted management frames which won't
be processed. One symptom of this is that we fail to negotiate block ack
with APs that support MFP.

Only echo the RSN capabilities which we support, i.e. key replay counters.
Handle MFP and PBAR bits here as done elsewhere. Neither of these features
is enabled yet at run-time. As far as I can tell, the remaining RSN caps are
not supported by drivers (e.g. SPP A-MPDU) or won't be supported (outdated
WEP->TKIP transition support). The corresponding bits should always be clear.

Problem with 0 input block ack sessions found by sthen@ and robert@
Fix tested by sthen@, robert@, phessler@, and kmos@

ok phessler@ kmos@

Revision 1.131 / (download) - annotate - [select for diffs], Tue May 19 18:57:57 2020 UTC (4 years ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8
Changes since 1.130: +1 -1 lines
Diff to previous 1.130 (colored)

Revert previous; Set the ESS capability bit in assoc requests again.

Association to some access points breaks without the ESS capability bit.
Apparently I misunderstood something.

Reported by krw@ and tb@

Revision 1.130 / (download) - annotate - [select for diffs], Tue May 19 08:34:19 2020 UTC (4 years ago) by stsp
Branch: MAIN
Changes since 1.129: +2 -2 lines
Diff to previous 1.129 (colored)

Do not set the 802.11 ESS capability bit in association requests.

The ESS capability bit should be set if the transmitter is an AP.
Association requests are sent by clients.

ok jca@

Revision 1.129 / (download) - annotate - [select for diffs], Fri Mar 6 11:54:49 2020 UTC (4 years, 3 months ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_6_7_BASE, OPENBSD_6_7
Changes since 1.128: +4 -4 lines
Diff to previous 1.128 (colored)

Properly wrap 802.11 frame sequence numbers when incrementing them.

ok tb@ tobhe@ mpi@

Revision 1.128 / (download) - annotate - [select for diffs], Tue Mar 3 18:54:50 2020 UTC (4 years, 3 months ago) by stsp
Branch: MAIN
Changes since 1.127: +7 -10 lines
Diff to previous 1.127 (colored)

Do not send any QoS data frames unless Tx aggregation has been negotiated.

Actual QoS support could be added to net80211 in the future, but for now we
only use QoS frames for A-MPDU aggregation. Without QoS support, sending
non-aggregated QoS frames does not actually buy us anything and makes it
harder to look at packet captures and tell whether frames sent by an OpenBSD
machine were in fact aggregated or not.

Tested on iwn(4) by jmc@, paco@, bket@, paco@, and Lauri Tirkkonen

Revision 1.127 / (download) - annotate - [select for diffs], Tue Feb 18 08:29:35 2020 UTC (4 years, 3 months ago) by stsp
Branch: MAIN
Changes since 1.126: +8 -9 lines
Diff to previous 1.126 (colored)

Fix an mbuf corruption issue which occurs in net80211 hostap mode.

When sizing a memory allocation for a probe response frame, the AP used
the SSID length stored in the node structure which represents the client,
but used the actual length of the SSID when copying it into the frame.

If the actual length is sufficiently large this will result in corruption
of an adjacent mbuf on the free list since m->m_next will be overwritten
with data written to the tail of the probe response frame.

Bad things happen later on when the adjacent mbuf is used. Sometimes
the corruption is detected by mbufpl's use-after-free checking, at
other times we end up crashing somewhere in the network stack.

To prevent such a mistake from occuring again I am removing the 'ni'
argument from ieee80211_get_probe_resp() altogether. It is not needed.

A quick workaround is to configure a short SSID.

Debugged with help from claudio, kettenis, and dlg.

ok claudio

Revision 1.126 / (download) - annotate - [select for diffs], Mon Jul 29 10:50:09 2019 UTC (4 years, 10 months ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.125: +171 -14 lines
Diff to previous 1.125 (colored)

Add support for 802.11n Tx aggregation to net80211 and the iwn(4) driver.

In particular, add Tx block ack session management to net80211, with
enough funcionality to support Tx aggregation on devices which perform
A-MPDU subframe scheduling in firmware.
Make use of the iwn(4) firmware Tx scheduler to build A-MPDUs.

net80211's QoS support code is now enabled and used by Tx aggregation.

A-MSDU frames inside A-MPDUs have been tested and work in principle.
For now, this feature is disabled because unfair TCP connection sharing
was observed during testing, where bursts of TCP Ack frames for a single
tcpbench(1) connection arriving in A-MSDUs made other TCP connections stall.
Switch off support for A-MSDUs inside A-MPDUs on the Rx side as well.

Tested on iwn chipsets 1000, 4965, 5100, 5300, 2200, 6200, 6205, 6300
(committed version of tested diff has all debug printfs removed)
tests/ok benno kmos mlarkin kevlo

Revision 1.125 / (download) - annotate - [select for diffs], Sun May 12 18:12:38 2019 UTC (5 years, 1 month ago) by stsp
Branch: MAIN
Changes since 1.124: +4 -3 lines
Diff to previous 1.124 (colored)

Fix 'ifconfig nwflags; These flags ended up overlapping with other flags
in ieee80211com's ic_flags because we haven't been paying attention to
them (they're not in the same place in the code and hence easy to miss).
Move them to a dedicated variable to avoid this problem in the future.

Add a new 'stayauth' nwflag which can be set to let net80211 ignore
deauth frames. This can be useful when deauth frames are being
persistently spoofed by an attacker. Idea from beck@

ok beck@ phessler@

Revision 1.124 / (download) - annotate - [select for diffs], Fri May 10 18:30:15 2019 UTC (5 years, 1 month ago) by patrick
Branch: MAIN
Changes since 1.123: +12 -11 lines
Diff to previous 1.123 (colored)

On the transmit path the ethernet and ip headers might not be
in contiguous memory.  Taking the pointer to the data and simply
looking at the IP header by adding an offset can lead to an out-
of-bounds access.  Make the ieee80211 classify function copy the
ethernet and ip header into stack variables to fix it.

Fixes a panic for florian@
Discussed with claudio@
ok stsp@

Revision 1.123 / (download) - annotate - [select for diffs], Fri Nov 30 09:26:06 2018 UTC (5 years, 6 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.122: +6 -6 lines
Diff to previous 1.122 (colored)

MH_ALIGN -> m_align and make the spacing look the same in all three places.
OK bluhm@

Revision 1.122 / (download) - annotate - [select for diffs], Thu Dec 14 18:52:17 2017 UTC (6 years, 5 months ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3
Changes since 1.121: +5 -3 lines
Diff to previous 1.121 (colored)

My previous commit broke the ramdisk build; fix it

Revision 1.121 / (download) - annotate - [select for diffs], Thu Dec 14 14:27:10 2017 UTC (6 years, 5 months ago) by stsp
Branch: MAIN
Changes since 1.120: +7 -5 lines
Diff to previous 1.120 (colored)

Stop printing debug info about stations leaving a wifi network when
we aren't running in hostap or ibss mode.

Revision 1.120 / (download) - annotate - [select for diffs], Mon Dec 11 22:23:00 2017 UTC (6 years, 6 months ago) by stsp
Branch: MAIN
Changes since 1.119: +6 -4 lines
Diff to previous 1.119 (colored)

Omit the PMKID count field from RSN information elements (IE) if the PMKID
list has zero elements and PMKID would be the last field in the RSN IE.

This is correct as per 802.11-2012 8.4.2.27.1 and aligns net80211 code with
behaviour of bwfm(4) firmware, unblocking further progress in that driver.

ok patrick@ phessler@

Revision 1.119 / (download) - annotate - [select for diffs], Sat Oct 21 20:15:17 2017 UTC (6 years, 7 months ago) by patrick
Branch: MAIN
Changes since 1.118: +1 -2 lines
Diff to previous 1.118 (colored)

Make ieee80211_classify() available in a header so we can make the
priority visible to underlying bus protocols like bwfm(4)'s bcdc.

Revision 1.118 / (download) - annotate - [select for diffs], Thu Feb 2 16:47:53 2017 UTC (7 years, 4 months ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.117: +7 -4 lines
Diff to previous 1.117 (colored)

Remove global counters from struct ieee80211com which track the number of
associated nodes with particular properties: 11b-only ("non-ERP") nodes,
nodes requiring long slot time, nodes using WPA, nodes not supporting 11n,
nodes currently dozing in powersave state, and nodes with a pending group
key update confirmation.

These counters weren't properly maintained.
There are bugs in the stack where these counters and actual node properties
got out of sync. This is exposed by panics which are supposed to help us
catch such bugs. But these panics don't provide real clues.

Instead of maintaining global counters forcing us to hunt refcounting bugs,
count nodes with the property in question on demand, by iterating over all
nodes and checking their state.
This is cheap since we'll never have more than 100 nodes cached, and none of
the cases where we need such information is in a performance critical path.

Prevents panics in hostap mode reported by Lauri Tirkkonen on bugs@ last
year (https://marc.info/?l=openbsd-bugs&m=147513817930489&w=2) and also
encountered by my 11n APs ("panic: bogus non-HT station count 0").

tested by Lauri, tb@, and myself
ok mpi@ tb@

Revision 1.117 / (download) - annotate - [select for diffs], Tue Jan 31 11:06:15 2017 UTC (7 years, 4 months ago) by stsp
Branch: MAIN
Changes since 1.116: +2 -2 lines
Diff to previous 1.116 (colored)

In a comment inside ieee80211_up_to_ac(), update a reference section
number from the 802.11-2007 standard to the 802.11-2012 standard.

Revision 1.116 / (download) - annotate - [select for diffs], Tue Jan 31 09:39:27 2017 UTC (7 years, 4 months ago) by stsp
Branch: MAIN
Changes since 1.115: +3 -3 lines
Diff to previous 1.115 (colored)

When telling clients which EDCA parameters to use, copy these parameters
from the client parameter set, rather than from the AP parameter set.
ok mpi@

Revision 1.115 / (download) - annotate - [select for diffs], Mon Jan 30 18:21:13 2017 UTC (7 years, 4 months ago) by stsp
Branch: MAIN
Changes since 1.114: +2 -4 lines
Diff to previous 1.114 (colored)

Enable ieee80211_edca_table, which was under #if 0. This table can be used
by drivers to pass default EDCA parameters to firmware instead of passing
local hardcoded values.
ok millert@

Revision 1.114 / (download) - annotate - [select for diffs], Mon Jan 9 16:24:20 2017 UTC (7 years, 5 months ago) by stsp
Branch: MAIN
Changes since 1.113: +2 -2 lines
Diff to previous 1.113 (colored)

Make the net80211 stack send EDCA parameters to the driver in hostap mode.
Fixes problems with timing of frame transmissions which caused packet loss.
tested by myself and tb@
ok phessler@ mpi@ tb@

Revision 1.113 / (download) - annotate - [select for diffs], Mon Jan 9 13:01:37 2017 UTC (7 years, 5 months ago) by stsp
Branch: MAIN
Changes since 1.112: +7 -4 lines
Diff to previous 1.112 (colored)

When acting as 11n hostap, send Microsoft WME parameters to clients so
that Linux clients will decide to use 11n mode.
ok phessler@

Revision 1.112 / (download) - annotate - [select for diffs], Mon Jan 9 09:30:02 2017 UTC (7 years, 5 months ago) by stsp
Branch: MAIN
Changes since 1.111: +4 -3 lines
Diff to previous 1.111 (colored)

Fix ieee80211_add_htop(), which is not yet called in active code paths.
It was creating a corrupt beacon element by ommitting one byte.
Fix this and fill the element with actual data from the ic_bss node instead
of filling it with zeroes, allowing future 11n hostap to announce the current
HT protection mode correctly.

Revision 1.111 / (download) - annotate - [select for diffs], Tue Apr 12 14:33:27 2016 UTC (8 years, 2 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.110: +2 -2 lines
Diff to previous 1.110 (colored)

Call if_enqueue() and if_start() instead of dereferencing the ifp
pointers.

These functions have been introduced to abstract some of the MP-
safeness^Wmadness and should be use everywhere.

Prodded by a comment from jsg@.

ok mikeb@, stsp@

Revision 1.110 / (download) - annotate - [select for diffs], Fri Feb 5 19:11:31 2016 UTC (8 years, 4 months ago) by stsp
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.109: +53 -1 lines
Diff to previous 1.109 (colored)

Define EDCA tables for 11n mode. Per 802.11-2012 they are the same as
the tables for 11a/11g modes.
Add a function to append a Microsoft WME parameter element to a frame,
using EDCA tables to construct the parameter records. Some 11n AP's I have
observed provide this element.

None of this code is used yet, so no functional change. I wrote this while
debugging BlockAck and then realized it was only needed for hostap mode.
Once we support 11n in hostap mode and send A-MPDUs, this code will be needed.

Revision 1.109 / (download) - annotate - [select for diffs], Fri Feb 5 16:07:57 2016 UTC (8 years, 4 months ago) by stsp
Branch: MAIN
Changes since 1.108: +5 -10 lines
Diff to previous 1.108 (colored)

Store ADDBA request and response parameters in the block ack record of
ieee80211_node. This way, we can keep track of the ACK policy and echo
it back to the AP as required by the standard. And use the correct bit
flag for the policy -- this code was confused between BlockAck and ADDBA,
both of which have a policy bit but in different places.

Fixes apple airport APs.

tested by tb@, krw@, sthen@, abieber@, and Henrik Friedrichsen

Revision 1.108 / (download) - annotate - [select for diffs], Thu Jan 21 20:33:20 2016 UTC (8 years, 4 months ago) by stsp
Branch: MAIN
Changes since 1.107: +3 -3 lines
Diff to previous 1.107 (colored)

Fix the timeout value sent in ADDBA request and response frames.
ba_timeout_val is in usec so we must divide by TU when copying it to the frame.
ok kettenis@ millert@

Revision 1.107 / (download) - annotate - [select for diffs], Tue Jan 12 09:28:09 2016 UTC (8 years, 5 months ago) by stsp
Branch: MAIN
Changes since 1.106: +1 -14 lines
Diff to previous 1.106 (colored)

Remove wireless turbo mode support. It is a non-standard extension
which only worked with ath(4) devices from a decade ago.
Diff tested on ath(4) hardware by me to verify that 11a/b modes still work.
ok reyk deraadt chris sthen kettenis

Revision 1.106 / (download) - annotate - [select for diffs], Wed Jan 6 19:56:50 2016 UTC (8 years, 5 months ago) by stsp
Branch: MAIN
Changes since 1.105: +2 -2 lines
Diff to previous 1.105 (colored)

Initialize the A-MPDU parameters field in HT capability elements.
ok kettenis@

Revision 1.105 / (download) - annotate - [select for diffs], Tue Jan 5 18:41:16 2016 UTC (8 years, 5 months ago) by stsp
Branch: MAIN
Changes since 1.104: +1 -23 lines
Diff to previous 1.104 (colored)

Remove the IEEE80211_NO_HT macro. Reduces ifdef spaghetti, enables 11n mode
in bsd.rd, and might uncover some bugs. Suggested by tedu@ and deraadt@.
ok sthen@ jasper@ deraadt@

Revision 1.104 / (download) - annotate - [select for diffs], Mon Jan 4 13:29:04 2016 UTC (8 years, 5 months ago) by stsp
Branch: MAIN
Changes since 1.103: +2 -3 lines
Diff to previous 1.103 (colored)

Fix another case where the return value of ieee80211_chan2mode() was
used for indexing something other than ic_sup_rates. Should have been
part of earlier commit.

Revision 1.103 / (download) - annotate - [select for diffs], Mon Jan 4 12:32:06 2016 UTC (8 years, 5 months ago) by stsp
Branch: MAIN
Changes since 1.102: +6 -2 lines
Diff to previous 1.102 (colored)

ADDBA frames have a parameter set which we check against our own capabilities
but we were checking bits in these parameters with the wrong set of bitmasks.
Negotiating A-MPDUs with some APs failed because of this bug.
ok kettenis@

Revision 1.102 / (download) - annotate - [select for diffs], Sat Dec 12 11:31:48 2015 UTC (8 years, 6 months ago) by stsp
Branch: MAIN
Changes since 1.101: +32 -7 lines
Diff to previous 1.101 (colored)

11n/HT negotiation fixes:

Some APs will not negotiate HT if the vendor-specific WME info
element is missing in probe and association requests, so add one.

Fix the wrong flag (NODE_HT) being checked to determine whether 11n
related elements should be included in management frames. If 11n mode
is enabled (F_HTON flag) we can always include 11n related elements
in management frames.

ok mpi@

Revision 1.101 / (download) - annotate - [select for diffs], Tue Nov 24 12:32:53 2015 UTC (8 years, 6 months ago) by mpi
Branch: MAIN
Changes since 1.100: +1 -2 lines
Diff to previous 1.100 (colored)

No need to include <net/if_types.h> for <net/if_vlan_var.h>

Revision 1.100 / (download) - annotate - [select for diffs], Sun Nov 15 01:05:25 2015 UTC (8 years, 6 months ago) by stsp
Branch: MAIN
Changes since 1.99: +9 -3 lines
Diff to previous 1.99 (colored)

Declare 802.11n mode and channel flags. Tweak 11n related fields in struct
ieee80211com and move them inside #ifndef IEEE80211_NO_HT without breaking
the build in rsu(4) for RAMDISK_CD.
Also declare 11n protection modes and MCS count.
ok deraadt mpi kettenis guenther

Revision 1.99 / (download) - annotate - [select for diffs], Sun Nov 8 18:48:07 2015 UTC (8 years, 7 months ago) by stsp
Branch: MAIN
Changes since 1.98: +3 -3 lines
Diff to previous 1.98 (colored)

Update section and table numbers inside comments in the RSN code to
the 802.11-2012 standard.
ok mpi@

Revision 1.98 / (download) - annotate - [select for diffs], Wed Nov 4 12:12:00 2015 UTC (8 years, 7 months ago) by dlg
Branch: MAIN
Changes since 1.97: +9 -15 lines
Diff to previous 1.97 (colored)

replace the ifqueues in net80211 with mbuf_queues.

the specific queues are ic_mgtq, ic_pwrsaveq, and ni_savedq. rtw
had its own queue for beacons.

tested by mpi@ and jmc@
ok mpi@

Revision 1.97 / (download) - annotate - [select for diffs], Wed Jul 15 22:16:42 2015 UTC (8 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.96: +3 -5 lines
Diff to previous 1.96 (colored)

m_freem() can handle NULL, do not check for this condition beforehands.
ok stsp mpi

Revision 1.96 / (download) - annotate - [select for diffs], Tue Jun 30 13:54:42 2015 UTC (8 years, 11 months ago) by mpi
Branch: MAIN
Changes since 1.95: +2 -2 lines
Diff to previous 1.95 (colored)

Rename if_output() into if_enqueue() to avoid confusion with comments
talking about (*ifp->if_output)().

ok claudio@, dlg@

Revision 1.95 / (download) - annotate - [select for diffs], Tue May 26 15:34:00 2015 UTC (9 years ago) by mpi
Branch: MAIN
Changes since 1.94: +3 -27 lines
Diff to previous 1.94 (colored)

Use if_output() instead of rerolling it.

ok stsp@

Revision 1.94 / (download) - annotate - [select for diffs], Sat Mar 14 03:38:51 2015 UTC (9 years, 3 months ago) by jsg
Branch: MAIN
Changes since 1.93: +1 -2 lines
Diff to previous 1.93 (colored)

Remove some includes include-what-you-use claims don't
have any direct symbols used.  Tested for indirect use by compiling
amd64/i386/sparc64 kernels.

ok tedu@ deraadt@

Revision 1.93 / (download) - annotate - [select for diffs], Tue Dec 23 03:24:08 2014 UTC (9 years, 5 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.92: +1 -7 lines
Diff to previous 1.92 (colored)

unifdef some more INET. v4 4life.

Revision 1.92 / (download) - annotate - [select for diffs], Sun Sep 14 14:17:26 2014 UTC (9 years, 8 months ago) by jsg
Branch: MAIN
Changes since 1.91: +1 -2 lines
Diff to previous 1.91 (colored)

remove uneeded proc.h includes
ok mpi@ kspillner@

Revision 1.91 / (download) - annotate - [select for diffs], Tue Jul 22 11:06:10 2014 UTC (9 years, 10 months ago) by mpi
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.90: +1 -2 lines
Diff to previous 1.90 (colored)

Fewer <netinet/in_systm.h> !

Revision 1.90 / (download) - annotate - [select for diffs], Wed Mar 19 10:09:19 2014 UTC (10 years, 2 months ago) by mpi
Branch: MAIN
Changes since 1.89: +11 -12 lines
Diff to previous 1.89 (colored)

Stop abusing the rcvif pointer to pass wireless nodes down to the
driver start routines.  Instead add & use a pointer in the pkthdr
since we don't want the overhead of using a mbuf_tags(9).

claudio@ pointed out that other subsystems might want to use this
pointer too, so here's a new cookie!

ok claudio@, mikeb@, deraadt@

Revision 1.89 / (download) - annotate - [select for diffs], Sat Dec 7 01:55:06 2013 UTC (10 years, 6 months ago) by brad
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.88: +3 -1 lines
Diff to previous 1.88 (colored)

#if 0 out the ieee80211_edca_table table to appease the LLVM warning.

ieee80211_output.c:311:5: error: unused variable 'ieee80211_edca_table' [-Werror,-Wunused-const-variable]

ok stsp@

Revision 1.88 / (download) - annotate - [select for diffs], Sat Jul 17 16:30:01 2010 UTC (13 years, 10 months ago) by damien
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.87: +2 -2 lines
Diff to previous 1.87 (colored)

use the correct block ack structure when building an ADDBA response.

Revision 1.87 / (download) - annotate - [select for diffs], Sun May 24 07:46:04 2009 UTC (15 years ago) by damien
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6
Changes since 1.86: +2 -2 lines
Diff to previous 1.86 (colored)

fix prev commit (s/ic_flags/ic_caps/).

from dhill@

Revision 1.86 / (download) - annotate - [select for diffs], Tue May 19 16:09:02 2009 UTC (15 years ago) by damien
Branch: MAIN
Changes since 1.85: +14 -9 lines
Diff to previous 1.85 (colored)

prevent injection of raw 802.11 control frames through bpf on drivers
that do not explicitly state this capability (using flag IEEE80211_C_RAWCTL).
also, perform all the sanity checks on injected raw 802.11 frames earlier
(in ieee80211_output instead of ieee80211_encap).

prevent kernel panics with many drivers when running aircrack-ng.
when/if all drivers are capable, we can remove this C_RAWCTL flag.

Revision 1.85 / (download) - annotate - [select for diffs], Thu Mar 26 20:34:54 2009 UTC (15 years, 2 months ago) by damien
Branch: MAIN
Changes since 1.84: +5 -3 lines
Diff to previous 1.84 (colored)

sync with 802.11w draft 8.0.
the SA Query Transaction Identifier field is now a 16-bit non-negative
counter value instead of a 128-bit random value.

Revision 1.84 / (download) - annotate - [select for diffs], Fri Mar 6 18:35:02 2009 UTC (15 years, 3 months ago) by damien
Branch: MAIN
Changes since 1.83: +2 -3 lines
Diff to previous 1.83 (colored)

Fix setting of the Short Slot Time subfield of the Capability Information
field in (Re)Association Requests.
This fixes association with APs refusing non-short-slot-time capable STAs.
This should also prevent the AP we're associating with to disable the use
of short slot time in the BSS as we join.
Fix debug message in recv_assoc_resp() while I'm here (s/reason/status/).
Scary.

Thanks to Adam Emanuel for spotting this.

Revision 1.83 / (download) - annotate - [select for diffs], Wed Jan 28 18:55:18 2009 UTC (15 years, 4 months ago) by damien
Branch: MAIN
CVS Tags: OPENBSD_4_5_BASE, OPENBSD_4_5
Changes since 1.82: +25 -15 lines
Diff to previous 1.82 (colored)

Block Ack agreements are unidirectional.
Maintain state for both originator and recipient roles separately.
Do not allocate receive reordering buffer in addba_request().
Test the "initiator" bit in incoming DELBA frames and set it appropriately
in outgoing DELBA frames.
Separate callbacks for Tx/Rx too.

no binary change since all this is #ifdef'ed out.

Revision 1.82 / (download) - annotate - [select for diffs], Mon Jan 26 21:28:55 2009 UTC (15 years, 4 months ago) by damien
Branch: MAIN
Changes since 1.81: +3 -2 lines
Diff to previous 1.81 (colored)

remove ni_ba field from ieee80211_node structure as it is not used yet.
this reduces memory footprint and avoids a stack usage warning in
ieee80211_find_node() that breaks amd64 build.

pointed out by landry@

Revision 1.81 / (download) - annotate - [select for diffs], Mon Jan 26 19:09:41 2009 UTC (15 years, 4 months ago) by damien
Branch: MAIN
Changes since 1.80: +333 -49 lines
Diff to previous 1.80 (colored)

Add some initial HT bits (not enabled yet) based on 802.11n Draft 7.01:
- implement A-MPDU frames buffering and reordering
- implement A-MSDU decapsulation
- process/send ADDBA Request, ADDBA Response and DELBA action frames
- process Block Ack Request control frames (including MTBAR)
- implement PBAC support (Protected Block Ack)
- add some incomplete HT Capabilities and HT Operation IEs parsing

Add more Management Frame Protection bits based on 802.11w Draft 7.0:
- implement SA Query procedure (both AP and STA)
- cleanup BIP

Fix some bugs:
- fix check for WEP key length that otherwise caused a stack smash in
  ieee80211_wep_encrypt (pointed out by Xavier Santolaria on macppc)
- properly stop EAPOL timeout: fixes a panic that occured in HostAP mode
  when turning the interface down while a 4-way handshake is in progress
  (pointed out by Doughertys)

Did some code cleanup too.

The HT bits are currently not compiled in (IEEE80211_NO_HT is defined)
because they won't be ready until after the next release and I didn't
want to grow the kernel or to inadvertently introduce new bugs.
They are here such that other people can look at the code.
Notice that I had to add an extra parameter to ic_send_mgmt() for
action frames, that is why there are small changes in drivers defining
their own ic_send_mgmt() handler.

Sorry for the not very incremental diff but this has been sitting in
my tree for too long now.

Revision 1.80 / (download) - annotate - [select for diffs], Tue Dec 2 17:37:11 2008 UTC (15 years, 6 months ago) by damien
Branch: MAIN
Changes since 1.79: +3 -8 lines
Diff to previous 1.79 (colored)

cleanup ieee80211_classify(): retrieve VLAN tag from m_pkthdr.ether_vtag.

Revision 1.79 / (download) - annotate - [select for diffs], Sat Sep 27 15:16:09 2008 UTC (15 years, 8 months ago) by damien
Branch: MAIN
Changes since 1.78: +13 -5 lines
Diff to previous 1.78 (colored)

Initial implementation of PMKSA caching and pre-authentication.
This will be required for future WPA-Enterprise support (802.1X).
Add ieee80211_needs_auth() function (not implemented yet) to
notify the userland 802.1X PACP machine when an 802.1X port
becomes enabled (that is after successfull 802.11 Open System
authentication).
Add SIOCS80211KEYRUN and SIOCS80211KEYAVAIL ioctls so that the
PACP state machine can kick the 802.11 key state machine and
install PMKs obtained from 802.1X (pre-)authentication.

Enable SHA-256 based AKMPs by default while I'm here (TGw).
This uses SHA-256 for key-derivation (instead of SHA1), AES-128-CMAC
for data integrity, and AES Key Wrap for data protection of EAPOL-Key
frames.  An OpenBSD AP will always advertise this capability and an
OpenBSD STA will always prefer SHA-256 based AKMPs over SHA1 based
ones if both are supported by an AP.

Revision 1.78 / (download) - annotate - [select for diffs], Sat Sep 27 15:00:08 2008 UTC (15 years, 8 months ago) by damien
Branch: MAIN
Changes since 1.77: +1 -2 lines
Diff to previous 1.77 (colored)

Add some inline functions to test the presence of optional 802.11
header fields (Sequence Control, Address 4, QoS Control, +HTC) and
use them where appropriate.

Add ieee80211_get_qos() inline function to extract the QoS control
field of an 802.11 header instead of duplicating the same scary
code everywhere (the location of this field depends on the presence
of an Address 4 field).

Export ieee80211_up_to_ac() so that drivers can select the access
category to use based on the TID subfield of the QoS Control field.

Define more QoS-related bits for the RSN Capabilities field of RSN IE
(will be used later).

Revision 1.77 / (download) - annotate - [select for diffs], Wed Sep 3 19:53:37 2008 UTC (15 years, 9 months ago) by damien
Branch: MAIN
Changes since 1.76: +4 -4 lines
Diff to previous 1.76 (colored)

third parameter of ieee80211_get_assoc_req() is a management frame
subtype, not a boolean indicating assoc or reassoc.
rename the parameter and use if (type == IEEE80211_FC0_SUBTYPE_REASSOC_REQ)
instead of if (reassoc).
it worked only because IEEE80211_FC0_SUBTYPE_ASSOC_REQ is equal to 0.

Revision 1.76 / (download) - annotate - [select for diffs], Mon Sep 1 19:55:21 2008 UTC (15 years, 9 months ago) by damien
Branch: MAIN
Changes since 1.75: +10 -6 lines
Diff to previous 1.75 (colored)

add ic_tid_noack bitmap to indicate a per-TID ACK policy (1=no ack,
0=normal ack).  all bits are currently set to 0.
use this bitmap to set the ACK policy of the QoS control field of
outgoing QoS frames.

Revision 1.75 / (download) - annotate - [select for diffs], Mon Sep 1 19:43:33 2008 UTC (15 years, 9 months ago) by damien
Branch: MAIN
Changes since 1.74: +46 -25 lines
Diff to previous 1.74 (colored)

extend ieee80211_classify() to extract DSCP field from IPv6 packets too.

Revision 1.74 / (download) - annotate - [select for diffs], Mon Sep 1 19:41:10 2008 UTC (15 years, 9 months ago) by damien
Branch: MAIN
Changes since 1.73: +57 -20 lines
Diff to previous 1.73 (colored)

rework previously unused ieee80211_pwrsave() function, call it from
ieee80211_mgmt_output() and ieee80211_encap().
use new IEEE80211_C_APPMGT capability flag where appropriate.
rename ic_tim_mcast to ic_tim_mcast_pending.

Revision 1.73 / (download) - annotate - [select for diffs], Fri Aug 29 12:14:53 2008 UTC (15 years, 9 months ago) by damien
Branch: MAIN
Changes since 1.72: +5 -44 lines
Diff to previous 1.72 (colored)

move code to support Frequency-Hopping spread spectrum (FHSS) PHYs
to the Attic.  nothing uses it in the tree and it is very unlikely
that something will use it one day.
the only driver supporting FHSS PHYs in the tree is ray(4) and it
does not use net80211.

Revision 1.72 / (download) - annotate - [select for diffs], Wed Aug 27 09:05:04 2008 UTC (15 years, 9 months ago) by damien
Branch: MAIN
Changes since 1.71: +33 -8 lines
Diff to previous 1.71 (colored)

introduce new IEEE80211_STA_ONLY kernel option that can be set to
remove IBSS and HostAP support from net80211 and 802.11 drivers.
it can be used to shrink RAMDISK kernels for instance (like what
was done for wi(4)).
it also has the benefit of highlighting what is specific to IBSS
and HostAP modes in the code.
the cost is that we now have two code paths to maintain.

Revision 1.71 / (download) - annotate - [select for diffs], Fri Aug 15 08:15:27 2008 UTC (15 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.70: +4 -4 lines
Diff to previous 1.70 (colored)

use LLC_SNAPFRAMELEN here too.

Revision 1.70 / (download) - annotate - [select for diffs], Tue Aug 12 19:56:59 2008 UTC (15 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.69: +19 -1 lines
Diff to previous 1.69 (colored)

add the code to encrypt/decrypt management frames, retrieve key id
from MMIE etc...
this code can't be triggered as no drivers claim MFP capability yet.

Revision 1.69 / (download) - annotate - [select for diffs], Tue Aug 12 19:29:07 2008 UTC (15 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.68: +12 -2 lines
Diff to previous 1.68 (colored)

new SHA-256 based AKMPs.

Revision 1.68 / (download) - annotate - [select for diffs], Tue Aug 12 19:21:04 2008 UTC (15 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.67: +23 -7 lines
Diff to previous 1.67 (colored)

add/process group integrity cipher suite in RSN IEs.
add support for MFP negotiation during association.

Revision 1.67 / (download) - annotate - [select for diffs], Tue Aug 12 19:05:39 2008 UTC (15 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.66: +13 -7 lines
Diff to previous 1.66 (colored)

add IEEE80211_RSNIE_MAXLEN and IEEE80211_WPAIE_MAXLEN definitions
instead of hard-coding values.
for RSN IE, request space for Group Integrity Cipher Suite.

Revision 1.66 / (download) - annotate - [select for diffs], Sat Aug 2 08:35:48 2008 UTC (15 years, 10 months ago) by damien
Branch: MAIN
CVS Tags: OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.65: +2 -2 lines
Diff to previous 1.65 (colored)

do not use IEEE80211_QOS_TID.  its definition in ieee80211.h is
wrong.  hard-code 0xf for now.  will be fixed post-release.

Revision 1.65 / (download) - annotate - [select for diffs], Sat Aug 2 08:33:21 2008 UTC (15 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.64: +8 -6 lines
Diff to previous 1.64 (colored)

do not touch m after it has been enqueued with IFQ_ENQUEUE().
copy m_pkthdr.len and m_flags before and use that after to update
the statistics.

from altq(4) man page and for consistency with what is done in
other parts of the tree.

Revision 1.64 / (download) - annotate - [select for diffs], Sat Aug 2 08:20:16 2008 UTC (15 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.63: +5 -3 lines
Diff to previous 1.63 (colored)

Drop frames that are received unencrypted when WEP is on or when
WPA is on and RX protection for TA is on.
Keep track of the TX/RX protection for each node when WPA is on.

tested by djm@ (ral+wpa), ckuethe@ (ath-noenc) and krw@ (wpi<->ral+wpa).
hints from bluhm@
has been in snaps for a few days.

pointed out by bluhm@ something like 1 year ago but we did not have
the right infrastructure to fix it properly at that time.

ok deraadt@

Revision 1.63 / (download) - annotate - [select for diffs], Sun Jul 27 14:21:15 2008 UTC (15 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.62: +7 -8 lines
Diff to previous 1.62 (colored)

s/IEEE80211_DPRINTF/DPRINTF/
automatically prepend __func__ to output.

deobfuscates debug messages a bit.
no binary change unless compiled with IEEE80211_DEBUG.

Revision 1.62 / (download) - annotate - [select for diffs], Wed Jul 23 15:55:46 2008 UTC (15 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.61: +2 -2 lines
Diff to previous 1.61 (colored)

Fix a blatant misuse of MINCLSIZE I introduced in ieee80211_output.c r1.59
The bug was added on 04/16 but it started to show up only after 06/12 when
the value of MINCLSIZE was changed to something different from MHLEN + 1.

Thanks to dlg@ and giovanni (qgiovanni at gmail dot com) for putting me
on the right track.

Tested by giovanni.
Should fix system/5881 too.

Revision 1.61 / (download) - annotate - [select for diffs], Mon Jul 21 19:27:26 2008 UTC (15 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.60: +2 -7 lines
Diff to previous 1.60 (colored)

add ieee80211_priv.h file: contains definitions private to net80211.
this must not be included by drivers.

Revision 1.60 / (download) - annotate - [select for diffs], Mon Jul 21 19:05:21 2008 UTC (15 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.59: +1 -565 lines
Diff to previous 1.59 (colored)

move processing of EAPOL frames away from ieee80211_{input,output}.c

Revision 1.59 / (download) - annotate - [select for diffs], Wed Apr 16 18:32:15 2008 UTC (16 years, 1 month ago) by damien
Branch: MAIN
Changes since 1.58: +265 -163 lines
Diff to previous 1.58 (colored)

Kernel implementation of the 4-way handshake and group-key
handshake protocols (both supplicant and authenticator state
machines) as defined in the IEEE 802.11i standard.

Software implementation of the TKIP (Temporal Key Integrity
Protocol) and CCMP (CTR with CBC-MAC Protocol) protocols.

This diff doesn't implement any of the 802.1X authentication
protocols and thus only PSK authentication (using pre-shared
keys) is currently supported.

In concrete terms, this adds support for WPA-PSK and WPA2-PSK
protocols, both in station and hostap modes.

The following drivers are marked as WPA-capable and should
work:  bwi(4), malo(4), ral(4), iwn(4), wpi(4), ural(4),
rum(4), upgt(4), and zyd(4)

The following options have been added to ifconfig(8):
wpa, wpapsk, wpaprotos, wpaakms, wpaciphers, wpagroupcipher

wpa-psk(8) can be used to generate keys from passphrases.

tested by many@
ok deraadt@

Revision 1.58 / (download) - annotate - [select for diffs], Mon Aug 27 20:14:21 2007 UTC (16 years, 9 months ago) by damien
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.57: +10 -3 lines
Diff to previous 1.57 (colored)

rework ieee80211_recv_4way_msg2() function.
add some RSNA authenticator state machine bits.

Revision 1.57 / (download) - annotate - [select for diffs], Mon Aug 27 18:53:27 2007 UTC (16 years, 9 months ago) by damien
Branch: MAIN
Changes since 1.56: +1 -4 lines
Diff to previous 1.56 (colored)

Checking the MIC early in ieee80211_recv_eapol() does not work for
message 2/4 of the 4-way handshake because the authenticator must
derive the PTK first (the MIC is computed using the KCK).
Move calls to ieee80211_eapol_key_check_mic() - and as a consequence
ieee80211_eapol_key_decrypt() - directly in the
ieee80211_recv_{group,4way}_msg*() functions.
Unconstify the first parameter since checking the MIC modifies the
frame. Remove ni->ni_ptk_ok field while i'm here.

Revision 1.56 / (download) - annotate - [select for diffs], Wed Aug 22 20:40:34 2007 UTC (16 years, 9 months ago) by damien
Branch: MAIN
Changes since 1.55: +16 -8 lines
Diff to previous 1.55 (colored)

- add k_rxmic and k_txmic fields to struct ieee80211_key to store the
  Tx/Rx MIC for TKIP.
- add two functions to map a PTK and a GTK to an IEEE 802.11 key and
  use them in ieee80211_input.c instead of duplicating the same code.
  properly set Tx/Rx MIC in the IEEE 802.11 key in the case of TKIP.
- add ic_psk to struct ieee80211com to store the pre-shared key.
- fix setting of the SECURE bit in outgoing EAPOL-Key frames.
- when receiving msg 2 of the 4-way handshake, deauthenticate the
  station if the RSN IE does not match that of the (Re)Association
  request.
- before parsing an RSN or WPA IE, check that there's enough room for
  the version field (2 bytes) which is mandatory.
- various tweaks while i'm here.

Revision 1.55 / (download) - annotate - [select for diffs], Sun Aug 5 21:41:11 2007 UTC (16 years, 10 months ago) by claudio
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.54: +2 -2 lines
Diff to previous 1.54 (colored)

Fix the length calculation of the TIM bitmask in ieee80211_add_tim().
Even no bit was set we copied the full 225bytes bitmaks into the beacon.
Found the hard way with acx(4) by mglocker@ and myself.
OK mglocker@ damien@

Revision 1.54 / (download) - annotate - [select for diffs], Fri Aug 3 16:51:06 2007 UTC (16 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.53: +77 -29 lines
Diff to previous 1.53 (colored)

add a ni_eapol_desc field to struct ieee80211_node to know whether
a station is using WPA1 or RSN descriptors.
make sure that a station that advertises WPA1 capability in an IE
uses the WPA1 EAPOL-Key descriptor type and not the RSN one.
fix construction of EAPOL-Key frames for WPA1.
i can now successfuly complete a 4-way and group-key handshake
with both a WPA1 and a WPA2 access point.
add some TKIP encapsulation code (no SW crypto yet).

ok deraadt@

Revision 1.53 / (download) - annotate - [select for diffs], Wed Aug 1 13:10:01 2007 UTC (16 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.52: +9 -3 lines
Diff to previous 1.52 (colored)

set key length field in message 1 & 3 of the 4-way handshake.

Revision 1.52 / (download) - annotate - [select for diffs], Wed Aug 1 12:47:55 2007 UTC (16 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.51: +4 -3 lines
Diff to previous 1.51 (colored)

pass the supplicant's nonce generated on reception of message 1 of the
4-way handshake to ieee80211_send_4way_msg2().

Revision 1.51 / (download) - annotate - [select for diffs], Wed Aug 1 12:26:16 2007 UTC (16 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.50: +3 -3 lines
Diff to previous 1.50 (colored)

fix parsing and construction of RSN/WPA IEs.

Revision 1.50 / (download) - annotate - [select for diffs], Wed Aug 1 12:15:48 2007 UTC (16 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.49: +8 -15 lines
Diff to previous 1.49 (colored)

the EAPOL-Key MIC must be computed with the MIC bit set.
this simplifies ieee80211_eapol_key_mic() and ieee80211_eapol_key_check_mic()
quite a bit.
set the EAPOL-Key body length before computing the MIC since the MIC is
computed with the 802.1X header too.
add a missing htons() while i'm here.

Revision 1.49 / (download) - annotate - [select for diffs], Wed Aug 1 11:59:40 2007 UTC (16 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.48: +3 -3 lines
Diff to previous 1.48 (colored)

cipher suite type for CCMP is 4 not 3.

Revision 1.48 / (download) - annotate - [select for diffs], Sat Jul 28 11:24:06 2007 UTC (16 years, 10 months ago) by damien
Branch: MAIN
Changes since 1.47: +435 -4 lines
Diff to previous 1.47 (colored)

adds functions to parse and to build EAPOL-Key frames used in
the 4-way and group-key handshake.
the state machine is still missing though so this is not used
anywhere yet.

Revision 1.47 / (download) - annotate - [select for diffs], Sat Jul 14 19:58:05 2007 UTC (16 years, 11 months ago) by damien
Branch: MAIN
Changes since 1.46: +44 -43 lines
Diff to previous 1.46 (colored)

update QoS Tx/Rx sequence numbers for each TID.
add a parameter to ieee80211_decap() to handle different 802.11
header sizes.
cleanup and clarify ieee80211_classify().

Revision 1.46 / (download) - annotate - [select for diffs], Fri Jul 13 19:59:56 2007 UTC (16 years, 11 months ago) by damien
Branch: MAIN
Changes since 1.45: +9 -11 lines
Diff to previous 1.45 (colored)

do not increment ic_stats.is_tx_nombuf in ieee80211_get_rts() and
ieee80211_get_cts_to_self() if mbuf allocation fails.

Revision 1.45 / (download) - annotate - [select for diffs], Fri Jul 6 19:00:56 2007 UTC (16 years, 11 months ago) by damien
Branch: MAIN
Changes since 1.44: +48 -72 lines
Diff to previous 1.44 (colored)

cleanup the computation of mgmt frames sizes.
still very ugly but hopefully correct.

Revision 1.44 / (download) - annotate - [select for diffs], Fri Jul 6 18:18:43 2007 UTC (16 years, 11 months ago) by damien
Branch: MAIN
Changes since 1.43: +5 -53 lines
Diff to previous 1.43 (colored)

remove remaining bits for pre-RSNA shared authmode support.
it has been #if 0'd since 3.9 and we have never supported this mode (no
ifconfig option etc...).

Revision 1.43 / (download) - annotate - [select for diffs], Thu Jul 5 21:35:45 2007 UTC (16 years, 11 months ago) by damien
Branch: MAIN
Changes since 1.42: +2 -7 lines
Diff to previous 1.42 (colored)

always set the IEEE80211_CAPINFO_ESS bit in association requests.
fixes my 1.36 commit (the bit should not be set for non-AP STA
only in Probe Responses and Beacons).

Revision 1.42 / (download) - annotate - [select for diffs], Thu Jul 5 20:29:22 2007 UTC (16 years, 11 months ago) by damien
Branch: MAIN
Changes since 1.41: +32 -20 lines
Diff to previous 1.41 (colored)

move the logic of determining whether an extended supported rates IE is
needed or not to the callers (instead of doing nothing in add_xrates).

Revision 1.41 / (download) - annotate - [select for diffs], Thu Jul 5 20:19:21 2007 UTC (16 years, 11 months ago) by damien
Branch: MAIN
Changes since 1.40: +59 -16 lines
Diff to previous 1.40 (colored)

split ieee80211_add_rsn() so that the code can be reused for
vendor-specific IE.

Revision 1.40 / (download) - annotate - [select for diffs], Wed Jul 4 20:18:00 2007 UTC (16 years, 11 months ago) by damien
Branch: MAIN
Changes since 1.39: +19 -5 lines
Diff to previous 1.39 (colored)

allow USEGROUP as the pairwise cipher for RSN IE.
add RSN IE to beacons, probe responses and (re)association requests.

Revision 1.39 / (download) - annotate - [select for diffs], Tue Jul 3 20:25:32 2007 UTC (16 years, 11 months ago) by damien
Branch: MAIN
Changes since 1.38: +11 -17 lines
Diff to previous 1.38 (colored)

maintain the traffic-indication (TIM) virtual bitmap by defining
a default ieee80211_set_tim() function that drivers can override
by setting ic_set_tim.

Revision 1.38 / (download) - annotate - [select for diffs], Tue Jul 3 19:44:54 2007 UTC (16 years, 11 months ago) by damien
Branch: MAIN
Changes since 1.37: +80 -1 lines
Diff to previous 1.37 (colored)

add a function that builds an RSN IE (ieee80211_add_rsn).

Revision 1.37 / (download) - annotate - [select for diffs], Tue Jul 3 16:43:41 2007 UTC (16 years, 11 months ago) by damien
Branch: MAIN
Changes since 1.36: +203 -171 lines
Diff to previous 1.36 (colored)

move construction of IEs into individual functions so that we don't
duplicate the same code multiple times.
add references to the spec for all these functions.
fixes beacon_alloc() for FH PHYs as a side-effect.

Revision 1.36 / (download) - annotate - [select for diffs], Tue Jul 3 16:10:38 2007 UTC (16 years, 11 months ago) by damien
Branch: MAIN
Changes since 1.35: +13 -9 lines
Diff to previous 1.35 (colored)

don't set the IEEE80211_CAPINFO_ESS bit in the Capability Information
field if we're not operating as an AP (see 7.3.1.4).

Revision 1.35 / (download) - annotate - [select for diffs], Tue Jul 3 16:07:10 2007 UTC (16 years, 11 months ago) by damien
Branch: MAIN
Changes since 1.34: +1 -9 lines
Diff to previous 1.34 (colored)

no TIM in probe reponses.

Revision 1.34 / (download) - annotate - [select for diffs], Tue Jul 3 16:03:48 2007 UTC (16 years, 11 months ago) by damien
Branch: MAIN
Changes since 1.33: +5 -2 lines
Diff to previous 1.33 (colored)

In ieee80211_getmbuf(), if we need to allocate a mbuf cluster because
the length is greater than MHLEN, test that the allocation succeeded.
Otherwise, free the mbuf header and return NULL.
Callers assume that if the function returns a value != NULL then
enough space has been allocated.

Revision 1.33 / (download) - annotate - [select for diffs], Tue Jul 3 16:00:07 2007 UTC (16 years, 11 months ago) by damien
Branch: MAIN
Changes since 1.32: +2 -2 lines
Diff to previous 1.32 (colored)

fix SSID IE in the case where HIDENWID is used.
HIDENWID has been broken from the very beginning.

Revision 1.32 / (download) - annotate - [select for diffs], Mon Jul 2 16:46:44 2007 UTC (16 years, 11 months ago) by damien
Branch: MAIN
Changes since 1.31: +38 -1 lines
Diff to previous 1.31 (colored)

initial bits for proper TIM support.

Revision 1.31 / (download) - annotate - [select for diffs], Mon Jul 2 16:19:49 2007 UTC (16 years, 11 months ago) by damien
Branch: MAIN
Changes since 1.30: +402 -271 lines
Diff to previous 1.30 (colored)

split ieee80211_send_mgmt() like I did for ieee80211_recv_mgmt()

Revision 1.30 / (download) - annotate - [select for diffs], Thu Jun 21 21:06:12 2007 UTC (16 years, 11 months ago) by damien
Branch: MAIN
Changes since 1.29: +65 -5 lines
Diff to previous 1.29 (colored)

add EDCA Parameter Set and QoS capability IEs to appropriate frames
when QoS is supported and activated.

Revision 1.29 / (download) - annotate - [select for diffs], Thu Jun 21 20:38:55 2007 UTC (16 years, 11 months ago) by damien
Branch: MAIN
Changes since 1.28: +135 -4 lines
Diff to previous 1.28 (colored)

add two new functions:

ieee80211_up_to_ac(): returns the access category to be used for
transmitting a frame with a given user priority.

ieee80211_classify(): returns the user-priority of an mbuf based
on VLAN 802.1D user-priority (if any) or IP TOS precedence field.

indent prototypes and add myself to the copyright list while i'm here.

Revision 1.28 / (download) - annotate - [select for diffs], Sat Jun 16 11:59:58 2007 UTC (17 years ago) by damien
Branch: MAIN
Changes since 1.27: +3 -3 lines
Diff to previous 1.27 (colored)

don't mix u_int{8,16,32}_t and uint{8,16,32}_t
use u_int{8,16,32}_t everywhere.

Revision 1.27 / (download) - annotate - [select for diffs], Sat Jun 16 11:56:20 2007 UTC (17 years ago) by damien
Branch: MAIN
Changes since 1.26: +7 -3 lines
Diff to previous 1.26 (colored)

de-static

ok jsg@

Revision 1.26 / (download) - annotate - [select for diffs], Mon Jun 11 19:35:24 2007 UTC (17 years ago) by damien
Branch: MAIN
Changes since 1.25: +100 -1 lines
Diff to previous 1.25 (colored)

adds 802.11e EDCA tables for QAPs and non-AP QSTAs.
not used yet.

ok jsg@ deraadt@

Revision 1.25 / (download) - annotate - [select for diffs], Thu Jun 7 20:20:15 2007 UTC (17 years ago) by damien
Branch: MAIN
Changes since 1.24: +1 -168 lines
Diff to previous 1.24 (colored)

move ieee80211_compute_duration() and ieee80211_compute_duration1()
functions into the two drivers that use them (atw and rtw.)
this code is not generic enough to be used by other drivers and
there is no chance that it will ever be used in newer driver since
it supports 802.11b only.
plus, it hurts my eyes each time i look into ieee80211_output.c.

"fine with me as long as the logic doesn't change in the functions" jsg@

Revision 1.24 / (download) - annotate - [select for diffs], Wed Jun 6 19:31:07 2007 UTC (17 years ago) by damien
Branch: MAIN
Changes since 1.23: +1 -5 lines
Diff to previous 1.23 (colored)

The license permits us to redistribute this code under the BSD or the GPLv2.
Choose the BSD license so that future enhancements will be BSD-only.

ok jsg@ reyk@ deraadt@

Revision 1.23 / (download) - annotate - [select for diffs], Mon Dec 25 19:24:26 2006 UTC (17 years, 5 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.22: +5 -3 lines
Diff to previous 1.22 (colored)

print the phy mode in IFF_DEBUG status output which helps to debug
dual/multi mode chipset operation.

ok jsg@

Revision 1.22 / (download) - annotate - [select for diffs], Fri Nov 3 19:02:08 2006 UTC (17 years, 7 months ago) by damien
Branch: MAIN
Changes since 1.21: +55 -1 lines
Diff to previous 1.21 (colored)

Add two new functions:
- ieee80211_get_rts
- ieee80211_get_cts_to_self
that can be use by drivers for chipsets that don't offer hardware assisted
RTS/CTS protection (like ral/ural/rum).

"no objections here" jsg@

Revision 1.21 / (download) - annotate - [select for diffs], Tue Jun 27 20:55:51 2006 UTC (17 years, 11 months ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.20: +5 -2 lines
Diff to previous 1.20 (colored)

add the net80211 hostap options "nwflag hidenwid" for hidden SSID mode
and "nwflag nobridge" to prevent inter-station communications.
"hidenwid" will also work with wi(4) to replace the old -E 3 option of
wicontrol.

ok damien@ jmc@

Revision 1.20 / (download) - annotate - [select for diffs], Sun Jun 18 18:39:41 2006 UTC (17 years, 11 months ago) by damien
Branch: MAIN
Changes since 1.19: +90 -35 lines
Diff to previous 1.19 (colored)

Improve 802.11b/g interoperability and move toward better compliance
with IEEE Std 802.11g-2003 standard:

- add ERP Information Element in probe responses and beacons
- keep track of the number of associated non-ERP STAs and non-short slot
  time capable STAs in the BSS
- enable use of RTS/CTS or CTS-to-self protection when required by the BSS
- add a ic_updateslot() callback to notify drivers of slot time changes
- cleanup computation of mgmt frames sizes in ieee80211_output.c
- nuke unnecessary <sys/cdefs.h> includes
- remove an unused macro (LOGICALLY_EQUAL) while i'm here

From {free,net}bsd, with additional fixes.

ok brad@, reyk@

Revision 1.19 / (download) - annotate - [select for diffs], Sun May 21 07:47:26 2006 UTC (18 years ago) by damien
Branch: MAIN
Changes since 1.18: +8 -5 lines
Diff to previous 1.18 (colored)

account for the size of a 802.11 header in ieee80211_getmbuf().
fix some typos while i'm here.

ok reyk@ brad@

Revision 1.18 / (download) - annotate - [select for diffs], Fri May 19 18:14:35 2006 UTC (18 years ago) by damien
Branch: MAIN
Changes since 1.17: +2 -5 lines
Diff to previous 1.17 (colored)

use ieee80211_add_ssid() in ieee80211_beacon_alloc() and wpi(4) instead
of duplicating the code.

last commit was ok reyk@

Revision 1.17 / (download) - annotate - [select for diffs], Fri May 19 18:06:51 2006 UTC (18 years ago) by damien
Branch: MAIN
Changes since 1.16: +9 -13 lines
Diff to previous 1.16 (colored)

- export ieee80211_add_ssid() just like ieee80211_add_(x)rates() so I don't
  need to duplicate the code in wpi(4)
- fix ieee80211_alloc_beacon()
- clean two comments while i'm here

Revision 1.16 / (download) - annotate - [select for diffs], Sat Mar 4 22:40:16 2006 UTC (18 years, 3 months ago) by brad
Branch: MAIN
Changes since 1.15: +2 -2 lines
Diff to previous 1.15 (colored)

With the exception of two other small uncommited diffs this moves
the remainder of the network stack from splimp to splnet.

ok miod@

Revision 1.15 / (download) - annotate - [select for diffs], Mon Feb 20 20:12:14 2006 UTC (18 years, 3 months ago) by damien
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.14: +1 -4 lines
Diff to previous 1.14 (colored)

Fix kernel builds without bpfilter. Linking is still broken.

"Please commit this diff ASAP" brad@

Revision 1.14 / (download) - annotate - [select for diffs], Wed Jan 11 00:18:17 2006 UTC (18 years, 5 months ago) by millert
Branch: MAIN
Changes since 1.13: +7 -5 lines
Diff to previous 1.13 (colored)

Disable shared key mode until we have a way for the user to specify
that they explicitly want it.  What we have currently doesn't seem
to work anyway.  Add support for specifying a status type when
sending managemnent frames; adapted from FreeBSD.  OK jsg@

Revision 1.13 / (download) - annotate - [select for diffs], Thu Sep 8 13:24:53 2005 UTC (18 years, 9 months ago) by reyk
Branch: MAIN
Changes since 1.12: +41 -46 lines
Diff to previous 1.12 (colored)

mostly knf

ok jsg@

Revision 1.12 / (download) - annotate - [select for diffs], Thu Sep 8 12:44:55 2005 UTC (18 years, 9 months ago) by jsg
Branch: MAIN
Changes since 1.11: +10 -8 lines
Diff to previous 1.11 (colored)

Remove the last of the FreeBSD compatiblity goop.
ok reyk@

Revision 1.11 / (download) - annotate - [select for diffs], Thu Sep 8 09:11:08 2005 UTC (18 years, 9 months ago) by jsg
Branch: MAIN
Changes since 1.10: +12 -9 lines
Diff to previous 1.10 (colored)

Remove FreeBSD if_printf compat function from net80211.
ok reyk@

Revision 1.10 / (download) - annotate - [select for diffs], Wed Sep 7 05:40:11 2005 UTC (18 years, 9 months ago) by jsg
Branch: MAIN
Changes since 1.9: +1 -36 lines
Diff to previous 1.9 (colored)

Remove FreeBSD/NetBSD ifdef mess.  We are not likely to be
doing a wholesale merge with them in future.
very enthusiastic ok from reyk@

Revision 1.9 / (download) - annotate - [select for diffs], Wed Apr 20 19:52:43 2005 UTC (19 years, 1 month ago) by reyk
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.8: +110 -1 lines
Diff to previous 1.8 (colored)

send raw 802.11 frames with bpf(4) using the IEEE802_11 or
IEEE802_11_RADIO data link types.

ok canacar@ damien@

Revision 1.8 / (download) - annotate - [select for diffs], Fri Mar 11 23:20:26 2005 UTC (19 years, 3 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.7: +2 -1 lines
Diff to previous 1.7 (colored)

Make sure we associate an interface with the m_pkthdr in
ieee80211_beacon_alloc.
ok damien@ reyk@

Revision 1.7 / (download) - annotate - [select for diffs], Thu Mar 3 14:36:41 2005 UTC (19 years, 3 months ago) by damien
Branch: MAIN
Changes since 1.6: +91 -1 lines
Diff to previous 1.6 (colored)

addtion of a generic function for allocating beacons: ieee80211_beacon_alloc().
ok jsg@, reyk@, dlg@

Revision 1.6 / (download) - annotate - [select for diffs], Sat Feb 26 15:49:34 2005 UTC (19 years, 3 months ago) by jsg
Branch: MAIN
Changes since 1.5: +3 -2 lines
Diff to previous 1.5 (colored)

Fix a problem introduced with the recent lru cache change.
Check that we actually have a node before trying to release it.
This was causing a panic when playing with IBSS. ok reyk@

Revision 1.5 / (download) - annotate - [select for diffs], Thu Feb 17 18:28:05 2005 UTC (19 years, 3 months ago) by reyk
Branch: MAIN
Changes since 1.4: +8 -11 lines
Diff to previous 1.4 (colored)

derived from NetBSD:

---
Make the node table into an LRU cache: least-recently used nodes
are at the end of the node queue.  Change the reference-counting
discipline: ni->ni_refcnt indicates how many times net80211 has
granted ni to the driver.  Every node in the table with ni_refcnt=0
is eligible to be garbage-collected.  The mere presence of a node
in the table does not any longer indicate its auth/assoc state;
nodes have a ni_state variable, now.

While I am here, patch ieee80211_find_node_for_beacon to do a "best
match" by bssid/ssid/channel, not a "perfect match."  This keeps
net80211 from caching duplicate nodes in the table.
---

ok deraadt@ dlg@, looks good jsg@

Revision 1.4 / (download) - annotate - [select for diffs], Tue Dec 28 23:07:32 2004 UTC (19 years, 5 months ago) by jsg
Branch: MAIN
Changes since 1.3: +44 -64 lines
Diff to previous 1.3 (colored)

Sync with recent NetBSD ieee80211_compute_duration() changes.

Revision 1.3 / (download) - annotate - [select for diffs], Thu Dec 23 12:27:25 2004 UTC (19 years, 5 months ago) by jsg
Branch: MAIN
Changes since 1.2: +28 -18 lines
Diff to previous 1.2 (colored)

From dyoung@NetBSD:

ieee80211.h r 1.9

#define the difference in microseconds between a fast and a slow
preamble and PLCP header.

ieee80211_output.c r 1.19

Fix a bug in ieee80211_compute_duration: the 802.11 Duration field
in an 802.11 unicast data packet is equal to the duration of the
SIFS and Acknowledgement.  That is, the amount of time reserved
*after* the packet has finished transmitting.

Change the arguments to ieee80211_compute_duration: pass the entire
packet length, not just the payload length.  Add a 'debug' argument
to ieee80211_compute_duration and its helper subroutine,
ieee80211_compute_duration1.

If debug != 0, ieee80211_compute_duration printfs its arguments
and several local variables.

In rtw(4), load the 802.11 Duration field with the result from
ieee80211_compute_duration.

Revision 1.2 / (download) - annotate - [select for diffs], Thu Dec 23 11:54:09 2004 UTC (19 years, 5 months ago) by jsg
Branch: MAIN
Changes since 1.1: +176 -1 lines
Diff to previous 1.1 (colored)

From dyoung@NetBSD:

Define for more bits in the Service field of the 802.11 PLCP Header.

For use by the subroutine ieee80211_compute_duration, add struct
ieee80211_duration, and #define a number of microsecond constants
used for the transmit timing of 802.11 packets.

Add the subroutine ieee80211_compute_duration, which computes for
any packet the appropriate 802.11 Duration field, the PLCP Length
field, as well as the Duration and Length fields for an RTS frame.

atw(4), rtw(4), future drivers, and possibly ath(4) will share
ieee80211_compute_duration.

ok millert@

Revision 1.1 / (download) - annotate - [select for diffs], Tue Jun 22 22:53:52 2004 UTC (19 years, 11 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6

Import current NetBSD/FreeBSD 802.11 framework.
Based in part on a diff from Matthew Gream.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.