summaryrefslogtreecommitdiff
path: root/sys/net80211
AgeCommit message (Collapse)Author
2014-03-20Do not pull <sys/tree.h> unconditionally in <net/if.h>, only the addressMartin Pieuchot
tree and the 80211 nodes need it. ok henning@, mikeb@
2014-03-19Stop abusing the rcvif pointer to pass wireless nodes down to theMartin Pieuchot
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@
2013-12-07#if 0 out the ieee80211_edca_table table to appease the LLVM warning.Brad Smith
ieee80211_output.c:311:5: error: unused variable 'ieee80211_edca_table' [-Werror,-Wunused-const-variable] ok stsp@
2013-12-01Reset txrate array index after changing a node's rate list.Stefan Sperling
Should prevent "bogus xmit rate %d setup" panics, which I ran into again in IBSS mode. ok kettenis
2013-11-21Remove unneeded include.Martin Pieuchot
ok deraadt@
2013-11-14improve maths and conditionals around ticks to cope with wraparound better.David Gwynne
2013-06-11Replace all ovbcopy with memmove; swap the src and dst arguments tooTheo de Raadt
ok otto
2013-03-24Make ieee80211_set_tim() available from outside of ieee80211_node.cClaudio Jeker
so drivers like acx(4) can use that function directly instead of reimplementing the function again. Requested by kettenis@ long time ago.
2013-01-17Create a printb() suitable string for IEEE80211_FC1 field. Needed to showClaudio Jeker
more info in tcpdump. OK giovanni@
2012-11-07Make the ieee80211_node_incref() macro a static inline function, as itsStefan Sperling
siblings already are. And fix return value of ieee80211_node_decref() which should be unsigned but was signed. diff originally from dhill; ok kettenis reyk
2012-11-07Fix DPRINTF() format string treating n->ni_refcnt, which is unsigned, as signed.Stefan Sperling
diff from dhill; ok kettenis reyk
2012-10-12Cleanup false positives for uninitialized uses.Christiano F. Haesbaert
Part of the work to remove -Wno-uninitialized. ok blambert jsg
2012-10-10Clear the powersave flag and purge queued packets when a node leaves the APMark Kettenis
(either by disassociating or by timeout). Fixes (most) remaining issues with power saving. From Nathanael Rensen. ok claudio@, krw@, sthen@
2012-10-05Point an interface directly to its bridgeport configuration, insteadCamiel Dobbelaar
of to the bridge itself. This is ok, since an interface can only be part of one bridge, and the parent bridge is easy to find from the bridgeport. This way we can get rid of a lot of list walks, improving performance and shortening the code. ok henning stsp sthen reyk
2012-09-20Nuke M_80211_NODE #define which mapped to M_DEVBUF and use M_DEVBUF directly.Stefan Sperling
ok henning
2012-08-25Set up ni_savedq for the initial BSS node such that it can actually be usedMark Kettenis
to store multicast frames when one of the associated stations is in power saving mode. ok stsp@
2012-08-17Fix possible panic while switching from STA mode into hostap/ibss modes.Stefan Sperling
ieee80211_create_ibss() resets the set of supported rates but failed to update the index into the rate set array accordingly. If the rate configured during STA operation didn't belong to the newly configured rate set the system ran into an assertion ("bogus xmit rate %u setup") while trying to create the IBSS. ok fgsch@
2012-07-18Print messages about nodes purged from the node cache if hostap/ibss modes areStefan Sperling
compiled in and the interface is in debug mode. ok sthen
2012-07-16Move increment of ic_nnodes closer to where the node is actually insertedStefan Sperling
into the cache. Make sure we're at IPL_NET while incrementing/decrementing ic_nnodes. Add a debug message that warns about possible node leaks. All of this affects hostap mode only.
2012-07-16Fix a couple of possible node leaks in ieee80211_input().Stefan Sperling
2012-07-13Fix wireless scanning on slow systems with a high RX rate and interfaceStefan Sperling
in debug mode. If the interface is in debug mode ieee80211_input() will print messages about received frames to the console. On slow systems, printf() calls can take so long that the next RX interrupt will be serviced immediately, if the RX rate is sufficiently high. This effectively locks the system at IPL_NET. If a concurrent scan is running, the scan will never finish because it relies on a timeout at IPL_SOFTCLOCK to hop channels every 200msec. This timeout never runs in the above situation, leaving the wireless interface in 'scan' state forever. To give the timeout a chance to run, perform the printf() call from a work queue (idea from guenther@). This allows edd's slow soekris AP to recover from 'ifconfig ral0 debug down up' in noisy RF environments. With input from guenther, kettenis, blambert and deraadt. ok deraadt
2012-07-13Tweak node cache eviction strategy when the cache is full: kick off new nodesStefan Sperling
in AUTH state that weren't active during the cache wait interval rather than keeping them for the entire cache timeout interval. Fixes association failures in noisy RF environments. Tested by edd and myself with a slow soekris suffering from RF noise with about of 50 interrupts per second on ral0. ok deraadt
2012-01-25There is no need to explicitly skip ic_bss when iterating over cached nodes.Stefan Sperling
The ic_bss is never put into the RB tree.
2012-01-25Clean inactive authenticated nodes during cache timeout as well.Stefan Sperling
There is no need to keep nodes cached with never associated and were inactive within the last 5 minutes or more. Keeps the node cache pretty clean in my environment with typical city-center wlan noise.
2012-01-21Implement missing bits of node inactivity accounting in hostap mode.Stefan Sperling
Small parts of code for this feature were already present but unused. A node becomes inactive after not sending or receiving a frame within 5 minutes. Inactive cached nodes (not authenticated or associated) are automatically cleared from the cache once every hour, making room for new nodes. If the node cache is full and room must be made for a new node, clean either a cached node (active or inactive), or an inactive authenticated or associated node. Also, do not send de-auth frames to nodes which never authenticated, and only send a de-auth frame once for a given node. This part was contributed by Steven Chamberlain, thanks! Tested by myself, krw@, edd@, Steven Chamberlain, and Markus Schatzl. ok deraadt@
2012-01-21Hold interrupts blocked while comparing a cached node's refcount to zeroStefan Sperling
and freeing the node. Just in case an interrupt happens to ref the node after the refcount was checked but before the node is freed. Tested by several as part of a larger diff.
2012-01-18Don't unconditionally allocate new nodes in the hostap auth frame input path.Stefan Sperling
Check if the node was already cached first. Duplicate nodes aren't reachable from the node cache's RB tree, so they leak and mess up node cache accounting. As more and more nodes leak the global nodes counter keeps increasing, eventually reaching the limit and hovering there. The system then constantly tries to clean the node cache, sending de-auth frames to stations in the process, even if the actual number of associated stations is small. ok jsg@
2012-01-18Make it possible to free cached nodes which never associated (e.g. nodesStefan Sperling
only scanning for networks). These were never put into COLLECT state and were thus never evicted from the node cache in hostap mode. ok jsg@
2011-05-04Collapse m_pullup and m_pullup2 into a single function, as they'reBret Lambert
essentially identical; the only difference being that m_pullup2 is capable of handling mbuf clusters, but called m_pullup for shorter lengths (!). testing dlg@ ok claudio@
2011-04-05Passing M_WAITOK to mbuf functions is supposed to be a contract betweenBret Lambert
the caller and the function that the function will not fail to allocate memory and return a NULL pointer. However, m_dup_pkthdr() violates this contract, making it possible for functions that pass M_WAITOK to be surprised in ways that hurt. Fix this by passing the wait flag all the way down the functions that actually do the allocation for m_dup_pkthdr() so that we won't be surprised. man page update forthcoming ok claudio@
2011-03-28Clean nodes until the number of cached nodes is smaller than the maximum numberMark Kettenis
of nodes, otherwise we'll never actually clean any nodes. Fixes issues with clients failing too attach because the node cache is completely filled. ok damien@
2011-03-04kill is_rx_elem_unknown.Federico G. Schwindt
damien@ ok. ports checked by sthen@.
2011-03-02Allow the kernel to compile with IEEE80211_DEBUG.Federico G. Schwindt
deraadt@ ok.
2011-02-21Fix stats about node allocation failures.Stefan Sperling
ok damien; committing with miod's permission (src is soft-locked)
2011-02-21When bridging multicast frames in hostap mode, make a deep copy of the mbufStefan Sperling
instead of a shallow copy to avoid problems if the mbuf is modified later (e.g. if the frame is encrypted). From FreeBSD. http://marc.info/?l=freebsd-current&m=114168135819304&w=2 http://svn.freebsd.org/viewvc/base?view=revision&revision=156367 ok damien; committing with miod's permission (src is soft-locked)
2011-01-11for key material that is being being discarded, convert bzero() toTheo de Raadt
explicit_bzero() where required ok markus mikeb
2010-09-29In the implementation of the SIOCS80211DELNODE ioctl, callMark Kettenis
ieee80211_node_leave() instead of ieee80211_release_node() which screws up reference counting and leads to use after free problems elsewhere in the code. Since ieee80211_node_leave() is only available if hostap support is compiled in, don't privide the SIOCS80211DELNODE ioctl if we're compiling without hostap support (e.g. on ramdisks). ok deraadt@, damien@
2010-08-07No "\n" needed at the end of panic() strings.Kenneth R Westerback
Bogus chunks pointed out by matthew@ and miod@. No cookies for marco@ and jasper@. ok deraadt@ miod@ matthew@ jasper@ macro@
2010-07-28Suspending drivers need to do as little as possible in here, so when theTheo de Raadt
transition is to INIT, try to not generate management frames if we can avoid it. ok damien
2010-07-20Switch some obvious network stack MAC comparisons from bcmp() toMatthew Dempsky
timingsafe_bcmp(). ok deraadt@; committed over WPA.
2010-07-19in hostap mode, notify drivers via a new callback when a STA leavesDamien Bergamini
the BSS. this is needed by drivers that need to maintain a hardware table of associated STAs (like ral(4) RT2860). idea from Nathanael Rensen
2010-07-17use the correct block ack structure when building an ADDBA response.Damien Bergamini
2010-07-17Drop 3rd and 4th clauses from David Young's license.Damien Bergamini
from NetBSD
2010-06-19In ieee80211_node_leave(), clear the associd after callingDamien Bergamini
ieee80211_node_leave_rsn() since ieee80211_node_leave_rsn() calls ic_delete_key() and drivers like ral(4) RT2860 need a valid associd in their delete_key callbacks. This affects HostAP mode only. from Nathanael Rensen. remove a useless (nested) #ifndef IEEE80211_STA_ONLY while i'm here
2010-06-14fix my previous commit, i forgot BIP, so instead of enumeratingDamien Bergamini
what is not supported as a group cipher, enumerate what is supported.
2010-06-14do not try to associate with an AP using an unsupported group cipher,Damien Bergamini
otherwise we will panic in ieee80211_add_rsn_body(). this may be the cause of a panic seen by reyk@ though i'm not 100% sure.
2010-06-07no need to include <sys/endian.h> twice!Damien Bergamini
2010-06-07tweak ieee80211_decap():Damien Bergamini
instead of copying the 802.11 header on the stack and building the ethernet header directly in the mbuf, build the ethernet header on the stack directly from the 802.11 header in the mbuf and copy the ethernet header to the mbuf after stripping the 802.11 header. makes the code easier to read/understand, especially, it is now explicit what is being put in the ether_type field. diff from Matthew Dempsky (matthew at dempsky dot org) moved ieee80211_align_mbuf() under #ifdef __STRICT_ALIGNMENT while i'm here.
2010-06-05when rekeying the GTK/IGTK, send the new key to clients, not theDamien Bergamini
old one. found after reading a post by Nathanael Rensen to tech@
2010-06-05there is no need to copy the full 802.11 header in ieee80211_decap()Damien Bergamini
as we do not use any field after i_addr4. slightly modified version of a diff from Matthew Dempsky (matthew at dempsky dot org), used MIN instead of min.