summaryrefslogtreecommitdiff
path: root/sys/net80211
AgeCommit message (Collapse)Author
2019-01-23Move 802.11n rateset definitions out of MiRA and make them available toStefan Sperling
net80211 and drivers in general. Add ratesets for 'short guard interval' (SGI) rates, and add SGI support to MiRA. SGI is currently only used by iwm(4), and of course internally by bwfm(4) firmware. Ratesets for 11n 40 MHz channels and 11ac will come later. ok mpi@ phessler@
2019-01-18when removing the currently active network from the join list, disconnectPeter Hessler
from it as well OK stsp@
2019-01-18add a len field when we delete an essid from the joinlist. this will havePeter Hessler
us properly match, instead of hoping we got lucky when selecting it. OK stsp@
2019-01-18let users automatically use join to connect to any open wifi network.Peter Hessler
if a known network is visible, always prefer that instead. requested by many, OK stsp@
2019-01-15Stop processing "no data" frames in ieee80211_input() before decryption.Stefan Sperling
Previously such frames would be counted as decryption failures which is nonsense because they don't carry any data which could be encrypted. Problem analyzed by, and fix developed together with, Lauri Tirkkonen.
2019-01-15Rename some data frame subtype macros to make the difference betweenStefan Sperling
"data" and "no data" frames more obvious. These renamed macros aren't actually used anywhere in net80211 yet. cross-checked with 802.11 specs by myself and Lauri Tirkkonen
2018-11-30MH_ALIGN -> m_align and make the spacing look the same in all three places.Claudio Jeker
OK bluhm@
2018-11-25print more details about the join'd networks we have saved when a user runsPeter Hessler
ifconfig if joinlist OK stsp@
2018-11-20fix whitespace in debugging functionPeter Hessler
2018-11-20The first packet received from each AP in each QoS class would bePatrick Wildt
dropped as the sequence number matches the initial value of the cached last sequence number (zero). On some APs (notably Android WIFI hotspots) this hits the first packet of the WPA2 4-way handshake. This causes connection delays and in some cases connection to the AP fails completely. Initialize the cached last sequence numbers for received packets to an invalid value instead. From Christian Ehrhardt ok gerhard@ stsp@
2018-11-12Add new routing socket message RTM_80211INFO to provide details ofKenneth R Westerback
802.11 interface state changes (e.g. SSID) to interested parties. Original diff from phessler@. Many suggestions and tweaks from claudio@, stsp@, anton@. ok claudio@ stsp@ anton@ phessler@
2018-11-09M_LEADINGSPACE() and M_TRAILINGSPACE() are just wrappers forClaudio Jeker
m_leadingspace() and m_trailingspace(). Convert all callers to call directly the functions and remove the defines. OK krw@, mpi@
2018-11-02Remove 'reused group key update received' printfs.Stefan Sperling
These have served no useful purpose in practice; all reported instances were legitimate group key retransmissions by the AP, e.g. after laptop suspend. We fixed KRACK long ago; re-used group key messages are nothing to worry about.
2018-10-27pass around the ess and ni structures we plan to use directly, insteadPeter Hessler
of rediscovering them (possibly badly). OK stsp@
2018-10-27clean up accounting of the AUTO_JOIN flag by making sure it is set or clearedPeter Hessler
based on the state of the joinlist OK stsp@
2018-10-27don't join to a network where we expect cleartext, and the AP is using cryptoPeter Hessler
OK stsp@
2018-09-24Prevent ieee80211_get_txkey() from returning the integrity group temporalStefan Sperling
key (IGTK) if a node doesn't have management frame protection (MFP) enabled. The IGTK is not initialized if MFP is disabled, so using it triggers this panic in ieee80211_encrypt(): panic("invalid key cipher 0x%x", k->k_cipher) (As far as I can tell, at present, MFP is never enabled.) Problem reported and fix tested by tj@ on athn(4) hostap
2018-09-18fix memory leak in ieee80211_end_scan()Ricardo Mestre
OK phessler@ jsg@
2018-09-17fix memory leaks in ieee80211_add_ess()Jonathan Gray
ok stsp@ phessler@
2018-09-11ues the format string for signed ints, for signed intsPeter Hessler
reminded by stsp@
2018-09-11Nuke unused LIST() ieee80211com_head.Kenneth R Westerback
ok stsp@
2018-09-11Nuke some trailing spaces that wandered into theKenneth R Westerback
crosshairs.
2018-09-11With the interface debug flag enabled, print a "score" for each AP wePeter Hessler
consider during auto-join. This can help users determine why a specific network was chosen. OK stsp@
2018-09-10do not immediately set the join'd network, the join command only updatesPeter Hessler
the list. makes /etc/netstart very fast when ran while the interface is up OK stsp@
2018-09-10fix typo in the length of the essid we want to switch toPeter Hessler
found with and OK stsp@
2018-09-10extract clearing WEP/WPA in ess into helper functionsPeter Hessler
2018-09-10use the correct essid when switching during the ioctl pathPeter Hessler
pointed out by stsp@
2018-09-10give set_ess a len variable, so we can correctly match the essid we wantPeter Hessler
to switch to. pointed out by stsp@
2018-09-09convert the things we save in 'join' into a single ioctl. mixing relatedPeter Hessler
settings over multiple calls was risky and racy. Pass essid, wpa, and wep paramaters in a single ioctl and process it atomically. no change for 'nwid' users OK stsp@ benno@
2018-09-06fix whitespaceJonathan Gray
2018-09-01Make 'ifconfig nwid' override 'ifconfig join'.Stefan Sperling
There was no way to override a decision made by join's network selection algorithm (apart from disabling the feature by clearing the join list). Automatic selection is based on heuristics which cannot always guess correctly so we need to provide an override. One specific problem was that if 'nwid foo' and 'nwid bar' were both visible in the scan and only 'nwid foo' was a member of the join list, then there was no way at all to connect to 'nwid bar'. The wireless stack would keep selecting 'nwid foo' instead. 'ifconfig iwm0 nwid bar' command will now disable automatic network selection and force the use of ESSID 'bar'. Any of these commands will re-enable automatic network selection: ifconfig iwm0 -nwid ifconfig iwm0 nwid '' ifconfig iwm0 join some-network-id ok phessler@ deraadt@
2018-08-15Update AP selection heuristics for auto-join.Stefan Sperling
We now prefer stronger crypto over weaker crypto over none, prefer 5 GHz band with reasonable RSSI, and use RSSI as a tie-breaker with a slight advantage for 5GHz. Candidate APs are now ranked by a score which is calculated based on these attributes. There is likely room for improvements to make these heuristics work well across many different environments, but it's a start. ok phessler@
2018-08-13Add support for band-steering access points to net80211.Stefan Sperling
Some access points have a feature called "band steering" where they will try to push clients from 2 GHz channels to 5 GHz channels. If a client sends probe-requests on both 2 GHz and 5GHz channels, and then attempts to authenticate on a 2 GHz channel, such APs will deny authentication and hope that the client will come back on a 5 GHz channel. So if we fail to AUTH for any reason, and if there is a different AP with the same ESSID that we haven't tried yet, try that AP next. Keep trying until no APs are left, and only then continue scanning. APs with support for this feature were provided by Mischa Peters. ok phessler@ mpi@
2018-08-11Add comment explaining why we read basic MCS set only from beacon/probereq.Stefan Sperling
requested by mpi@
2018-08-07Ignore basic MCS set information found in association responses.Stefan Sperling
Some APs (Aruba 105) send a bogus basic MCS set in assoc responses which prevents us from enabling 11n support with those APs, while these APs still behave as if were were an 11n client which renders the association unusable. The basic MSC set is already provided in beacons anyway, and the 802.11 2012 standard says the basic MSC set is reserved in frames other than beacons (see Table 8-130). ok mpi@
2018-08-06Fix debug message in ieee80211_auth_open(): s/reason/status/Stefan Sperling
Status codes and reason codes are separate things listed in distinct tables. This debug message made me look at the wrong table and scratch my head.
2018-08-06make ifconfig <if> join display the list of networks configured forSebastian Benoit
auto-join with feedback from florian and stsp ok florian@ phessler@ (on previous versions of the diff) stsp@
2018-08-06Refactor ieee80211_add_ess():Stefan Sperling
Drop ieee80211_add_ess's nwid parameter. Read nwid and length directly from the ic to make it more obvious where this function is reading from. nwids are binary data with an explicit length, so treat them as such instead of treating them like strings. ok florian phessler
2018-08-06Do not set nwid over and over again. We just found the ess by comparingFlorian Obser
the nwid. It will not have changed in the meantime. OK stsp
2018-08-03revert 1.133 and part of 1.131Peter Hessler
the stack doesn't always fill in the paramaters correctly reported by many
2018-07-30Don't ask drivers to join a wifi network before an AP has been chosen.Stefan Sperling
Should fix a panic with bwfm(4) reported by mlarkin@ ok phessler@
2018-07-19ieee80211_ess_is_better() returns 0 or 1, comparing > 1 is alwaysFlorian Obser
false so we always selected the first wifi available, not the best one. While here shuffle some deck chairs to make it clearer that anything is better than nothing. tweak & OK phessler
2018-07-16the AP sends their crypto parameters as a mask, so let us still select itPeter Hessler
in case we want WPA2 and they have WPA1 still enabled
2018-07-16don't save or use auto-join when the card is not in station (aka client) modePeter Hessler
OK stsp@
2018-07-13Some more checks before auto-join switches networks.Peter Hessler
Make sure all of the crypto options the AP announces matches what we would configure. While here, don't switch if the user has specified a specific BSSID, and the new AP does not match. OK stsp@
2018-07-11Disambiguate the source of panics in sys/net* by adding __func__Nayden Markatchev
magic constant to panic() calls. ok benno@ henning@ tb@
2018-07-11Introduce 'auto-join' to the wifi 802.11 stack.Peter Hessler
This allows a system to remember which ESSIDs it wants to connect to, any relevant security configuration, and switch to it when the network we are currently connected to is no longer available. Works when connecting and switching between WPA2/WPA1/WEP/clear encryptions. example hostname.if: join home wpakey password join work wpakey mekmitasdigoat join open-lounge join cafe wpakey cafe2018 join "wepnetwork" nwkey "12345" dhcp inet6 autoconf up OK stsp@ reyk@ and enthusiasm from every hackroom I've been in for the last 3 years
2018-05-23add missing newlines for debug printfsPeter Hessler
OK stsp@
2018-05-05On 5GHz channels, keep the most recent RSSI measurement from a probeStefan Sperling
response in case a lower RSSI is measured for a subsequent beacon. I have run into a 5Ghz AP which sends beacons with very low Tx power for some reason, while probe responses are transmitted with reasonable signal strength. This change ensures such 5GHz APs will be considered as a reasonable choice during access point selection. Discussed with sthen@, Patrick Dohman, and others on tech@ ok phessler@ pirofti@
2018-04-29Don't bother with background scans while the desired BSSID is fixed.Stefan Sperling
Patch by Jesper Wallin