summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211_node.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Revised version of 'ifconfig mode' command fix.stsp2019-06-101-11/+6
| | | | | | | | | | The 'mode' command is supposed to force a wireless interface into 11a/b/g/n media mode. This stopped working some time ago, probably during my work on background scanning. Problem spotted by mlarkin@ who noticed that interfaces were using 11g mode while forced to 11b mode. ok phessler, jmatthew (earlier version) relentless testing by krw@
* Revert my "Repair the 'ifconfig mode' command" commit.stsp2019-05-311-2/+3
| | | | | The "recursion in end_scan()" problem is apparently still present in the committed version of the diff (reported by krw@).
* Repair the 'ifconfig mode' command.stsp2019-05-291-3/+2
| | | | | | | | | The 'mode' command is supposed to force a wireless interface into 11a/b/g/n media mode. This stopped working some time ago, probably during my work on background scanning. Problem spotted by mlarkin@ who noticed that interfaces were using 11g mode while forced to 11b mode. ok phessler, jmatthew
* Show driver name on net80211 scan debug lines.stsp2019-05-111-2/+2
| | | | ok mpi@
* Removes the KERNEL_LOCK() from bridge(4)'s output fast-path.mpi2019-04-281-5/+5
| | | | | | | | This redefines the ifp <-> bridge relationship. No lock can be currently used across the multiples contexts where the bridge has tentacles to protect a pointer, use an interface index. Tested by various, ok dlg@, visa@
* fix autojoin for WEP network by actually saving the WEP auth keyphessler2019-03-151-2/+5
| | | | discovered while attempting to autojoin WEP networks
* Improve handling of HT protection for 'mode 11n' hostap.stsp2019-03-011-12/+32
| | | | | | | | | | | | | Consider the mere presence of HTCAP IEs as indicator of 11n support, rather than checking advertised Rx MCS. Fixes some devices being misclassified as 11a/g, causing HT protection to be enabled even though it is not needed. Use CTS-to-self frames for HT protection instead of RTS/CTS. These changes make my athn(4) AR9280 hostap perform much better. ok phessler@
* Move 802.11n rateset definitions out of MiRA and make them available tostsp2019-01-231-2/+3
| | | | | | | | 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@
* add a len field when we delete an essid from the joinlist. this will havephessler2019-01-181-5/+5
| | | | | | us properly match, instead of hoping we got lucky when selecting it. OK stsp@
* let users automatically use join to connect to any open wifi network.phessler2019-01-181-8/+17
| | | | | | if a known network is visible, always prefer that instead. requested by many, OK stsp@
* print more details about the join'd networks we have saved when a user runsphessler2018-11-251-1/+5
| | | | | | ifconfig if joinlist OK stsp@
* fix whitespace in debugging functionphessler2018-11-201-6/+6
|
* The first packet received from each AP in each QoS class would bepatrick2018-11-201-2/+6
| | | | | | | | | | | | 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@
* pass around the ess and ni structures we plan to use directly, insteadphessler2018-10-271-18/+15
| | | | | | of rediscovering them (possibly badly). OK stsp@
* clean up accounting of the AUTO_JOIN flag by making sure it is set or clearedphessler2018-10-271-1/+3
| | | | | | based on the state of the joinlist OK stsp@
* don't join to a network where we expect cleartext, and the AP is using cryptophessler2018-10-271-1/+4
| | | | OK stsp@
* fix memory leak in ieee80211_end_scan()mestre2018-09-181-1/+2
| | | | OK phessler@ jsg@
* fix memory leaks in ieee80211_add_ess()jsg2018-09-171-3/+7
| | | | ok stsp@ phessler@
* ues the format string for signed ints, for signed intsphessler2018-09-111-3/+3
| | | | reminded by stsp@
* With the interface debug flag enabled, print a "score" for each AP wephessler2018-09-111-93/+45
| | | | | | | consider during auto-join. This can help users determine why a specific network was chosen. OK stsp@
* fix typo in the length of the essid we want to switch tophessler2018-09-101-2/+2
| | | | found with and OK stsp@
* extract clearing WEP/WPA in ess into helper functionsphessler2018-09-101-29/+29
|
* give set_ess a len variable, so we can correctly match the essid we wantphessler2018-09-101-9/+5
| | | | | | to switch to. pointed out by stsp@
* convert the things we save in 'join' into a single ioctl. mixing relatedphessler2018-09-091-35/+151
| | | | | | | | | 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@
* fix whitespacejsg2018-09-061-2/+2
|
* Make 'ifconfig nwid' override 'ifconfig join'.stsp2018-09-011-1/+15
| | | | | | | | | | | | | | | | | | | | | 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@
* Update AP selection heuristics for auto-join.stsp2018-08-151-76/+178
| | | | | | | | | | | | 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@
* Add support for band-steering access points to net80211.stsp2018-08-131-56/+79
| | | | | | | | | | | | | | | | 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@
* Add comment explaining why we read basic MCS set only from beacon/probereq.stsp2018-08-111-1/+6
| | | | requested by mpi@
* Ignore basic MCS set information found in association responses.stsp2018-08-071-3/+4
| | | | | | | | | | | | | 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@
* Refactor ieee80211_add_ess():stsp2018-08-061-5/+6
| | | | | | | | | | 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
* Do not set nwid over and over again. We just found the ess by comparingflorian2018-08-061-4/+3
| | | | | the nwid. It will not have changed in the meantime. OK stsp
* revert 1.133 and part of 1.131phessler2018-08-031-8/+1
| | | | | | the stack doesn't always fill in the paramaters correctly reported by many
* Don't ask drivers to join a wifi network before an AP has been chosen.stsp2018-07-301-10/+1
| | | | | Should fix a panic with bwfm(4) reported by mlarkin@ ok phessler@
* ieee80211_ess_is_better() returns 0 or 1, comparing > 1 is alwaysflorian2018-07-191-6/+6
| | | | | | | | | | 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
* the AP sends their crypto parameters as a mask, so let us still select itphessler2018-07-161-6/+4
| | | | in case we want WPA2 and they have WPA1 still enabled
* don't save or use auto-join when the card is not in station (aka client) modephessler2018-07-161-2/+6
| | | | OK stsp@
* Some more checks before auto-join switches networks.phessler2018-07-131-1/+25
| | | | | | | | 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@
* Introduce 'auto-join' to the wifi 802.11 stack.phessler2018-07-111-1/+345
| | | | | | | | | | | | | | | | | | | | | 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
* When starting a background scan, free the nodes table to ensure westsp2018-04-281-5/+5
| | | | | | | | | 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@
* Fix the scan loop: We were only looking for an AP once and stoppedstsp2018-04-271-4/+2
| | | | | | scanning if none was found. Accidentally broken in recent ifconfig scan changes by pirofti and me. ok pirofti
* net80211: stub SIOCS80211SCAN, make ifconfig scan instant.pirofti2018-04-261-26/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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@.
* convert the test if a node support HT (aka, 11n) into an inline function,phessler2018-02-061-3/+3
| | | | | | instead of testing some un-obvious bitfield OK stsp@
* Don't dereference IEEE80211_CHAN_ANYC pointer in ieee80211_node_checkrssi().stsp2017-12-121-1/+4
| | | | Problem reported by Gregoire Jadi on bugs@
* Allow interfaces that aren't SCANNALLBAND drivers to benefit from thephessler2017-12-121-9/+10
| | | | | | strongest received signal. OK stsp@
* Fix the behavior of preferring weaker-but-still-good 5Ghz APs overjcs2017-12-121-26/+29
| | | | | | | | | 2Ghz APs because the 5Ghz band is generally less saturated. The previous implementation was dependent upon the order of walking APs. ok stsp
* Add support for background scanning to net80211 and iwm(4).stsp2017-12-081-42/+218
| | | | | | | | | | 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
* When starting a new scan always set the mode to AUTO if the driver scansstsp2017-09-051-2/+3
| | | | | | all bands at once. Fixes a problem where e.g. 5GHz APs were filtered out if we were previously associated to an 11g-only AP. ok mpi@ phessler@
* Add an entry to dmesg if pairwise WPA keys arrive unexpectedly or if WPAstsp2017-08-171-1/+2
| | | | | | | | | | group keys are being reused. OpenBSD wireless clients will now leave a trail of such events in their message log. There has been increased public scrutiny of WPA's security recently, so I am curious to see if anyone is attempting replay attacks in the wild. ok deraadt
* Compile a debug printf in ieee80211_match_bss() by default, previouslystsp2017-08-041-6/+4
| | | | | | | | guarded by the IEEE80211_DEBUG preprocessor flag. This shows one line per detected AP after a scan, and indicates which APs are considered candidates for association. Shorten the output a bit to fit into 80 columns more likely. ok sthen@