summaryrefslogtreecommitdiff
path: root/sys/net80211
AgeCommit message (Collapse)Author
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
2018-04-29INIT->RUN transitions are valid in monitor mode, so don'tStefan Sperling
debug print "invalid transition" to dmesg in this case.
2018-04-28When starting a background scan, free the nodes table to ensure weStefan Sperling
get an up-to-date view of APs around us. In particular, we need to kick out the AP we are associated to. Otherwise, our current AP might stay cached if it is turned off while we are scanning, and we could end up picking a now non-existent but "good looking" AP over and over. found with and ok phessler@
2018-04-28Fix WEP key selection in ieee80211_get_txkey().Stefan Sperling
The WEP key index is stored in ic_def_txkey. The iGTK ("integrity group key") index is specific to WPA. The previous code happened to always select WEP key index 0 since the iGTK index is not yet used by any driver. ok phessler@
2018-04-28If ieee80211_encrypt() is passed a key with an unrecognized cipherStefan Sperling
type then panic immediately instead of silently dropping packets. ok phessler@
2018-04-27If a wifi driver does not provide an ic_bgscan_start() function there is noStefan Sperling
point in scheduling ic_bgscan_timeout() since this timeout will find that it has nothing to do. ok phessler pirofti
2018-04-27Fix WEP.Stefan Sperling
Clear group keys in iee80211_newstate only if we're doing WPA. Otherwise, ieee80211_crypto_clear_groupkeys() will clear WEP keys configured by userland before associating. (All WEP keys are group keys.) ok phessler@ tb@ pirofti@
2018-04-27Fix the scan loop: We were only looking for an AP once and stoppedStefan Sperling
scanning if none was found. Accidentally broken in recent ifconfig scan changes by pirofti and me. ok pirofti
2018-04-26net80211: stub SIOCS80211SCAN, make ifconfig scan instant.Paul Irofti
The following removes the functionality of the SIOCS80211SCAN ioctl. After long discussions with stps@, mpi@, and deraadt@ we decided that this was the correct way of fixing ifconfig scan from blocking the network stack. The kernel will continue scanning in the background and filling the nodes array, but ifconfig scan commands will now basically do just a SIOCG80211ALLNODES and pretty print the array. So the output stays the same but is instant. In fact, when the interface is freshly brought up, if you type fast enough, you can see the array being filled by running multiple ifconfig scans in sequence. The SIOCS80211SCAN ioctl stays for now as wi(4), pgt(4) and malo(4) still need it around. But not for long... Another change that this introduces is the fact that ifconfig scan no longer plays with UP and DOWN. If the interface is down it complains and exits. This is needed in order to maintain the nodes list. Works on iwm(4), iwn(4), urtwn(4), run(4) and athn(4). Tested by mpi@, landry@, florian@, thanks! OK mpi@.
2018-04-20remove the background scan timeout on detach, so we don't crash shortlyJonathan Matthew
afterwards. crash reported by Piotr Isajew ok stsp@
2018-02-19Remove almost unused `flags' argument of suser().Martin Pieuchot
The account flag `ASU' will no longer be set but that makes suser() mpsafe since it no longer mess with a per-process field. No objection from millert@, ok tedu@, bluhm@
2018-02-06convert __inline to inlinePeter Hessler
no binary change on amd64
2018-02-06convert the test if a node support HT (aka, 11n) into an inline function,Peter Hessler
instead of testing some un-obvious bitfield OK stsp@
2018-02-06remove extern from function prototypes, remove some variable names, and aPeter Hessler
left-over kernel malloc feature we don't use. OK deraadt@
2018-02-05Add a new function hook to struct ieee80211com which wireless driversStefan Sperling
can use to process, and then acknowledge or reject, incoming AUTH requests in hostap mode. net80211 accepts an AUTH request from any STA which fits into the node cache. This behaviour doesn't work for devices which have a lower limit on concurrent STAs they can serve, so such drivers need an override. This will be used by our athn(4) USB driver soon. ok kevlo@
2017-12-21Call if_start() directly to send the EAPOL key.Martin Pieuchot
Using if_enqueue() here, from interrupt context, might result in the packet beeing enqueued, incorrectly encrypted, on the TX ring. This race has been recently exposed by the re-introduction of the TX mitigation. It exists because the net80211 stack sets IEEE80211_NODE_TXPROT on the node while processing the 3rd message, assuming the answer has already been transmitted. However a CPU returns from if_enqueue() it cannot assume that the send queue is empty. So call if_start() to flush this queue. Encrypting the 4th message of the 4way handshake with the new key breaks WPA handshake as found the hardway by anton@. Race analysed by dlg@, a lot of net80211 inputs and suggetions from stsp@. ok stsp@, dlg@
2017-12-14My previous commit broke the ramdisk build; fix itStefan Sperling
2017-12-14Stop printing debug info about stations leaving a wifi network whenStefan Sperling
we aren't running in hostap or ibss mode.
2017-12-12Only trigger background scans while we are in RUN state, and do not updateStefan Sperling
a node's RSSI info while we are still in INIT state. ok phessler@
2017-12-12Make ieee80211_chan2ieee() panic if a bogus channel pointer is detected.Stefan Sperling
ok patrick@
2017-12-12Make IEEE80211_CHAN_ANYC be a NULL pointer instead of a pointer to 0xffff.Stefan Sperling
Should speed up debugging. ok phessler patrick
2017-12-12Don't dereference IEEE80211_CHAN_ANYC pointer in ieee80211_node_checkrssi().Stefan Sperling
Problem reported by Gregoire Jadi on bugs@
2017-12-12Allow interfaces that aren't SCANNALLBAND drivers to benefit from thePeter Hessler
strongest received signal. OK stsp@
2017-12-12Fix the behavior of preferring weaker-but-still-good 5Ghz APs overJoshua Stein
2Ghz APs because the 5Ghz band is generally less saturated. The previous implementation was dependent upon the order of walking APs. ok stsp
2017-12-11Omit the PMKID count field from RSN information elements (IE) if the PMKIDStefan Sperling
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@
2017-12-08Add support for background scanning to net80211 and iwm(4).Stefan Sperling
The iwm(4) driver will now roam between access points which share an SSID. Use 'ifconfig iwm0 debug' and 'tail -f /var/log/messages' to watch it do so. Tested by several people in various iterations. As usual, let me know if you run into issues. ok phessler deraadt
2017-11-27Stop reporting WPA and WEP keys back to userland.Stefan Sperling
The kernel is not a password database; look your wifi keys up elsewhere. Discussed with several. ok phessler@ jca@
2017-11-06move a function declaration, so the whole net80211 stack can disable wep or wpaPeter Hessler
OK stsp@
2017-11-05Changing nwid on a wifi network means it is a new network, so clear thePeter Hessler
WPA and WEP configuration. OK pirofti@ stsp@ sthen@
2017-10-29Kill unused members using forward declaration only types.Martin Pieuchot
Found with ctfconv(1). ok jsg@, guenther@
2017-10-27Remove 80211WMMPARMS ioctls. Last used in ifconfig in 2009.Jonathan Gray
ok stsp@ kevlo@ jca@
2017-10-26Move common code to add/remove multicast filters to ieee80211_ioctl(9).Martin Pieuchot
ok jsg@, stsp@