802.11 header + opt(crypto header) + LLC writable, regardless of
crypto state. If s/w crypto is enabled, still make the entire
chain writable, as before.
Reviewed by: Nick Hudson
before testing the key flags.
XXX Problems remain. Nick Hudson points out my questionable
XXX M_COPY_PKTHDR usage. Also, it seems to me that we may not be
XXX protected against writing a read-only mbuf during the crypto
XXX encapsulation stage, even if hardware does the actual crypto.
as I thought. The latter actually sets the station listen interval.
We cannot get/set "drop-unencrypted" and "privacy" properties
independently with SIOCS80211NWKEY, so put back IEEE80211_IOC_PRIVACY
and IEEE80211_IOC_DROPUNENCRYPTED.
Thanks Sam Leffler for pointing out my mistakes.
compile support for the duplicate ioctls from FreeBSD if it is a
COMPAT_FREEBSD kernel:
IEEE80211_IOC_SSID
IEEE80211_IOC_WEPTXKEY
IEEE80211_IOC_CHANNEL
IEEE80211_IOC_PRIVACY
IEEE80211_IOC_DROPUNENCRYPTED
IEEE80211_IOC_BSSID
IEEE80211_IOC_BEACON_INTERVAL
IEEE80211_IOC_WEPKEY
in NetBSD 2.0:
* If 2.x compatibility is enabled (#ifdef COMPAT_20),
compile support for OSIOCG80211STATS and OSIOCG80211ZSTATS,
with the same ioctl numbers as SIOCG80211STATS and
SIOCG80211ZSTATS in 2.x. OSIOCG80211STATS and
OSIOCG80211ZSTATS return an ieee80211_ostats struct,
which has the same layout as ieee80211_stats in 2.x.
* Add new ioctl numbers for SIOCG80211STATS and SIOCG80211ZSTATS.
Both these ioctls will copy at most ifr_buflen bytes of
the new ieee80211_stats to ifr_buf.
back out my change to ieee80211_crypto_encap that made it free its
mbuf argument on error. I had thought it was a bug. It was not.
It's the drivers that are broken. Make an(4), atw(4), ipw(4),
iwi(4), ral(4), rtw(4), ural(4), and wi(4) free the mbuf when
ieee80211_crypto_encap returns NULL. Also, return ath(4) to the
way it was---i.e., free the mbuf.
Thanks to Sam Leffler to pointing out my mistake.
count on the node that is passed in, because it belongs to the
driver. Also, do not increase the reference count on the refined
node, because ieee80211_refine_node_for_beacon's caller (ieee80211_input)
will never decrease the reference count.
As a general rule, reference counts are used for driver code to
assert ownership of ieee80211_nodes that are shared by the driver
and net80211 layer.
the RX direction, but not in the TX direction. The
net80211 crypto framework doesn't seem to cope very well
with the assymetry (I'm probably missing something), so
I will use software WEP for now.
net80211: In ieee80211_compute_duration, figure out whether to add
the WEP header to the packet overhead by checking the
WEP bit in the Frame Control field of the 802.11 header,
instead of checking the IEEE80211_F_PRIVACY flag.
Also, if the WEP bit is present, assume that the frame
described by (wh, len) has already already been WEP
encapsulated, and adjust the payload length accordingly.
XXX that's a grotty hack that I will have to revisit,
later.
Change the way we walk 802.11 peers/clients: for each eligible
interface, walk the ic_sta (peers/clients) table, first; walk the
ic_scan (scan results) table, second; then visit the ic_bss (node
for the network joined/created by the interface).
The __UNCONST macro is now used only where necessary and the RW macros
are gone. Most of the changes here are consumers of the
sysctl_createv(9) interface that now takes a pair of const pointers
which used not to be.
(mail@janderson.ca): remove ieee80211_ibss_merge's TSFT argument.
Do the TSFT comparison in the drivers (ath, atw). Remove a lot of
extraneous debug statements from ieee80211_ibss_merge.
Set the ieee80211_node's state to IEEE80211_STA_BSS after it's been
copied to the ic_bss, not before.
In struct ieee80211_node, make the ni_tstamp field a union of a
uint64_t and the 8 TSF octets so that it's easier to compare a
neighbor's TSF with the local TSF.
Log IBSS merges (Greg Troxel's suggestion). Also log IBSS creation.
These are rare and important events that deserve to be logged.
Set a shorter 802.11 Duration field, accordingly.
XXX We expect CTS/ACK at 1 Mb/s for 1 & 2 Mb/s stations; and CTS/ACK
at 2 Mb/s for 5.5 & 11 Mb/s stations. We need to check with the
802.11 standard. Rate negotiation may need to be overhauld for
standards compliance, too.