aboutsummaryrefslogtreecommitdiff
path: root/net
AgeCommit message (Collapse)AuthorFilesLines
2008-08-22rfkill: introduce RFKILL_STATE_MAXHenrique de Moraes Holschuh1-3/+8
While it is interesting to not add last-enum-markers because it allows gcc to warn us of switch() statements missing a valid state, we really should be handling memory corruption on a rfkill state with default clauses, anyway. So add RFKILL_STATE_MAX and use it where applicable. It makes for safer code in the long run. Signed-off-by: Henrique de Moraes Holschuh <[email protected]> Acked-by: Ivo van Doorn <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-08-22rfkill: add __must_check annotationsHenrique de Moraes Holschuh1-2/+3
rfkill is not a small, mere detail in wireless support. Once it starts supporting rfkill and users start counting on that support, a wireless device is at risk of operating in dangerous conditions should rfkill support fail to properly activate. Therefore, add the required __must_check annotations on some key functions of the rfkill API, for which the wireless drivers absolutely MUST handle the failure mode safely in order to avoid a potentially dangerous situation where the wireless transmitter is left enabled when the user don't want it to. Signed-off-by: Henrique de Moraes Holschuh <[email protected]> Acked-by: Ivo van Doorn <[email protected]> Cc: Matthew Garrett <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-08-22rfkill: add default global states (v2)Henrique de Moraes Holschuh2-12/+116
Add a second set of global states, "rfkill_default_states", to track the state that will be used when the first rfkill class of a given type is registered, and also to save "undo" information when rfkill_epo is called. Add a new exported function, rfkill_set_default(), which can be used by platform drivers to restore radio state saved by the platform across reboots or shutdown. Also, fix rfkill_epo to properly update rfkill_states, but still preserve a copy of the state so that we can undo the effect of rfkill_epo later if we want to. Add rfkill_restore_states() to restore rfkill_states from the copy. Signed-off-by: Henrique de Moraes Holschuh <[email protected]> Acked-by: Ivo van Doorn <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-08-22rfkill: detect bogus double-registering (v2)Henrique de Moraes Holschuh1-1/+28
Detect and abort with -EEXIST if rfkill_register is called twice on the same rfkill struct. And WARN_ON(it) for good measure. While at it, flag when we are adding the first switch of a type, we will need that information later. Signed-off-by: Henrique de Moraes Holschuh <[email protected]> Acked-by: Ivo van Doorn <[email protected]> Cc: Johannes Berg <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-08-22mac80211: allow no mac address until firmware loadLuis Carlos Cobo1-0/+38
Originally by Johannes Berg. This patch adds support for devices that do not report their MAC address until the firmware is loaded. While the address is not known, a multicast on is used. Signed-off-by: Luis Carlos Cobo <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-08-22mac80211: remove WLAN_FC_DATA_PRESENTHarvey Harrison1-2/+0
All users are gone now. Signed-off-by: Harvey Harrison <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-08-22mac80211: remove rx/tx_data->fc memberHarvey Harrison3-9/+4
Signed-off-by: Harvey Harrison <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-08-22mac80211: use ieee80211 frame control directlyHarvey Harrison3-51/+44
Remove the last users of the rx/tx_data->fc data members and use the le16 frame_control from the header directly. Signed-off-by: Harvey Harrison <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-08-22mac80211: remove IEEE80211_FC helperHarvey Harrison5-33/+31
Signed-off-by: Harvey Harrison <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-08-22mac80211: remove ieee80211_get_hdrlenHarvey Harrison1-39/+0
All users have been moved over to the version taking a le16 frame control rather than a cpu-endian value. Signed-off-by: Harvey Harrison <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-08-22mac80211: rx.c/tx.c remove more users of tx/rx_data->fcHarvey Harrison2-39/+25
Those functions that still use ieee80211_get_hdrlen are moved over to use the little endian frame control. Signed-off-by: Harvey Harrison <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-08-22mac80211: wep.c replace magic numbers in IV/ICV removalHarvey Harrison1-4/+3
Signed-off-by: Harvey Harrison <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-08-22mac80211: wme.h remove unused QOS_CONTROL_LENHarvey Harrison1-2/+0
linux/ieee80211.h now has IEEE80211_QOS_CTL_LEN for this purpose. Signed-off-by: Harvey Harrison <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-08-22mac80211: explicitly check skb->lenHarvey Harrison1-14/+11
ieee80211_get_hdrlen_from_skb internally checks the skb is long enough to hold the full ieee80211_hdr, else it returns zero. Use ieee80211_hdrlen which always returns the hdrlen and check the remaining room in the skb explicitly when removing encryption headers or the qos control field. Signed-off-by: Harvey Harrison <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-08-22mac80211: radiotap: assume modulation from ratesBruno Randolf1-1/+4
use the rates ERP flag to derive CCK or OFDM modulation for the radiotap header. (it might be more correct to get this information from the hardware itself, but it seems safe to assume this in most practical cases.) Signed-off-by: Bruno Randolf <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-08-22mac80211: add rx status flag for short preambleBruno Randolf1-0/+2
and use it for the radiotap header Signed-off-by: Bruno Randolf <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-08-22mac80211: add ieee80211_queue_stopped)Tomas Winkler1-0/+7
This patch adds ieee80211_queue_stopped that let drivers to query queue status Signed-off-by: Tomas Winkler <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-08-22WIRELESS: Make wireless one-click selectable.Robert P. J. Day1-2/+6
Use "menuconfig" to make wireless support one-click selectable. Signed-off-by: Robert P. J. Day <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-08-22net/ieee80211: adjust error handlingJulia Lawall1-4/+4
Converts a test in error handling code to a sequence of labels. The semantic match that found the problem is: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @@ expression E,E1,E2; @@ E = alloc_etherdev(...) ... when != E = E1 if (...) { ... free_netdev(E); ... return ...; } ... when != E = E2 ( if (...) { ... when != free_netdev(E); return dev; } | * if (...) { ... when != free_netdev(E); return ...; } | register_netdev(E) ) // </smpl> Signed-off-by: Julia Lawall <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-08-22pkt_sched: Fix qdisc list lockingJarek Poplawski2-8/+41
Since some qdiscs call qdisc_tree_decrease_qlen() (so qdisc_lookup()) without rtnl_lock(), adding and deleting from a qdisc list needs additional locking. This patch adds global spinlock qdisc_list_lock and wrapper functions for modifying the list. It is considered as a temporary solution until hfsc_dequeue(), netem_dequeue() and tbf_dequeue() (or qdisc_tree_decrease_qlen()) are redone. With feedback from Herbert Xu and David S. Miller. Signed-off-by: Jarek Poplawski <[email protected]> Acked-by: Herbert Xu <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-08-21pkt_sched: Fix qdisc_watchdog() vs. dev_deactivate() raceJarek Poplawski2-0/+8
dev_deactivate() can skip rescheduling of a qdisc by qdisc_watchdog() or other timer calling netif_schedule() after dev_queue_deactivate(). We prevent this checking aliveness before scheduling the timer. Since during deactivation the root qdisc is available only as qdisc_sleeping additional accessor qdisc_root_sleeping() is created. With feedback from Herbert Xu <[email protected]> Signed-off-by: Jarek Poplawski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-08-21sctp: fix potential panics in the SCTP-AUTH API.Vlad Yasevich2-22/+67
All of the SCTP-AUTH socket options could cause a panic if the extension is disabled and the API is envoked. Additionally, there were some additional assumptions that certain pointers would always be valid which may not always be the case. This patch hardens the API and address all of the crash scenarios. Signed-off-by: Vlad Yasevich <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-08-19pkt_sched: Prevent livelock in TX queue running.David S. Miller1-1/+3
If dev_deactivate() is trying to quiesce the queue, it is theoretically possible for another cpu to livelock trying to process that queue. This happens because dev_deactivate() grabs the queue spinlock as it checks the queue state, whereas net_tx_action() does a trylock and reschedules the qdisc if it hits the lock. This breaks the livelock by adding a check on __QDISC_STATE_DEACTIVATED to net_tx_action() when the trylock fails. Based upon feedback from Herbert Xu and Jarek Poplawski. Signed-off-by: David S. Miller <[email protected]>
2008-08-19Merge branch 'master' of ↵David S. Miller6-192/+194
git://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetooth-2.6
2008-08-19ipvs: Fix race conditions in lblcr schedulerSven Wegener1-115/+114
We can't access the cache entry outside of our critical read-locked region, because someone may free that entry. Also getting an entry under read lock, then locking for write and trying to delete that entry looks fishy, but should be no problem here, because we're only comparing a pointer. Also there is no need for our own rwlock, there is already one in the service structure for use in the schedulers. Signed-off-by: Sven Wegener <[email protected]> Signed-off-by: Simon Horman <[email protected]>
2008-08-19ipvs: Fix race conditions in lblc schedulerSven Wegener1-108/+96
We can't access the cache entry outside of our critical read-locked region, because someone may free that entry. And we also need to check in the critical region wether the destination is still available, i.e. it's not in the trash. If we drop our reference counter, the destination can be purged from the trash at any time. Our caller only guarantees that no destination is moved to the trash, while we are scheduling. Also there is no need for our own rwlock, there is already one in the service structure for use in the schedulers. Signed-off-by: Sven Wegener <[email protected]> Signed-off-by: Simon Horman <[email protected]>
2008-08-19Merge branch 'master' of ↵Simon Horman17-146/+215
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
2008-08-18Revert "pkt_sched: Add BH protection for qdisc_stab_lock."David S. Miller1-7/+7
This reverts commit 1cfa26661a85549063e369e2b40275eeaa7b923c. qdisc_destroy() runs fully under RTNL again and not from softint any longer, so this change is no longer needed. Signed-off-by: David S. Miller <[email protected]>
2008-08-18Revert "pkt_sched: Protect gen estimators under est_lock."David S. Miller1-5/+4
This reverts commit d4766692e72422f3b0f0e9ac6773d92baad07d51. qdisc_destroy() now runs in RTNL fully again, so this change is no longer needed. Signed-off-by: David S. Miller <[email protected]>
2008-08-18pkt_sched: remove bogus block (cleanup)Ilpo Järvinen1-7/+6
...Last block local var got just deleted. Signed-off-by: Ilpo Järvinen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-08-18nf_nat: use secure_ipv4_port_ephemeral() for NAT port randomizationStephen Hemminger1-2/+6
Use incoming network tuple as seed for NAT port randomization. This avoids concerns of leaking net_random() bits, and also gives better port distribution. Don't have NAT server, compile tested only. Signed-off-by: Stephen Hemminger <[email protected]> [ added missing EXPORT_SYMBOL_GPL ] Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-08-18netfilter: ctnetlink: sleepable allocation with spin lock bhPablo Neira Ayuso1-1/+1
This patch removes a GFP_KERNEL allocation while holding a spin lock with bottom halves disabled in ctnetlink_change_helper(). This problem was introduced in 2.6.23 with the netfilter extension infrastructure. Signed-off-by: Pablo Neira Ayuso <[email protected]> Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-08-18netfilter: ctnetlink: fix sleep in read-side lock sectionPablo Neira Ayuso1-1/+1
Fix allocation with GFP_KERNEL in ctnetlink_create_conntrack() under read-side lock sections. This problem was introduced in 2.6.25. Signed-off-by: Pablo Neira Ayuso <[email protected]> Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-08-18netfilter: ctnetlink: fix double helper assignation for NAT'ed conntracksPablo Neira Ayuso1-15/+19
If we create a conntrack that has NAT handlings and a helper, the helper is assigned twice. This happens because nf_nat_setup_info() - via nf_conntrack_alter_reply() - sets the helper before ctnetlink, which indeed does not check if the conntrack already has a helper as it thinks that it is a brand new conntrack. The fix moves the helper assignation before the set of the status flags. This avoids a bogus assertion in __nf_ct_ext_add (if netfilter assertions are enabled) which checks that the conntrack must not be confirmed. This problem was introduced in 2.6.23 with the netfilter extension infrastructure. Signed-off-by: Pablo Neira Ayuso <[email protected]> Signed-off-by: Patrick McHardy <[email protected]>
2008-08-18netfilter: ipt_addrtype: Fix matching of inverted destination address typeAnders Grafström1-1/+1
This patch fixes matching of inverted destination address type. Signed-off-by: Anders Grafström <[email protected]> Signed-off-by: Patrick McHardy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-08-18Merge branch 'master' of ↵David S. Miller2-4/+12
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6
2008-08-18dccp: Fix panic caused by too early termination of retransmission mechanismGerrit Renker1-6/+6
Thanks is due to Wei Yongjun for the detailed analysis and description of this bug at http://marc.info/?l=dccp&m=121739364909199&w=2 The problem is that invalid packets received by a client in state REQUEST cause the retransmission timer for the DCCP-Request to be reset. This includes freeing the Request-skb ( in dccp_rcv_request_sent_state_process() ). As a consequence, * the arrival of further packets cause a double-free, triggering a panic(), * the connection then may hang, since further retransmissions are blocked. This patch changes the order of statements so that the retransmission timer is reset, and the pending Request freed, only if a valid Response has arrived (or the number of sysctl-retries has been exhausted). Further changes: ---------------- To be on the safe side, replaced __kfree_skb with kfree_skb so that if due to unexpected circumstances the sk_send_head is NULL the WARN_ON is used instead. Signed-off-by: Gerrit Renker <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-08-18pkt_sched: Don't hold qdisc lock over qdisc_destroy().David S. Miller2-17/+2
Based upon reports by Denys Fedoryshchenko, and feedback and help from Jarek Poplawski and Herbert Xu. We always either: 1) Never made an external reference to this qdisc. or 2) Did a dev_deactivate() which purged all asynchronous references. So do not lock the qdisc when we call qdisc_destroy(), it's illegal anyways as when we drop the lock this is free'd memory. Signed-off-by: David S. Miller <[email protected]>
2008-08-18pkt_sched: Add lockdep annotation for qdisc locksJarek Poplawski1-0/+7
Qdisc locks are initialized in the same function, qdisc_alloc(), so lockdep can't distinguish tx qdisc lock from rx and reports "possible recursive locking detected" when both these locks are taken eg. while using act_mirred with ifb. This looks like a false positive. Anyway, after this patch these locks will be reported more exactly. Reported-by: Denys Fedoryshchenko <[email protected]> Signed-off-by: Jarek Poplawski <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-08-18pkt_sched: Never schedule non-root qdiscs.David S. Miller2-2/+2
Based upon initial discovery and patch by Jarek Poplawski. The qdisc watchdogs can be attached to any qdisc, not just the root, so make sure we schedule the correct one. CBQ has a similar bug. Signed-off-by: David S. Miller <[email protected]>
2008-08-18mac80211: update new sta's rx timestampRon Rindjunsky1-0/+2
This patch fixes needless probe request caused by zero value in sta->last_rx inside ieee80211_associated flow Signed-off-by: Ron Rindjunsky <[email protected]> Signed-off-by: Tomas Winkler <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-08-18rfkill: protect suspended rfkill controllersHenrique de Moraes Holschuh1-4/+10
Guard rfkill controllers attached to a rfkill class against state changes after class suspend has been issued. Signed-off-by: Henrique de Moraes Holschuh <[email protected]> Acked-by: Ivo van Doorn <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2008-08-18[Bluetooth] Consolidate maintainers informationMarcel Holtmann5-5/+5
The Bluetooth entries for the MAINTAINERS file are a little bit too much. Consolidate them into two entries. One for Bluetooth drivers and another one for the Bluetooth subsystem. Also the MODULE_AUTHOR should indicate the current maintainer of the module and actually not the original author. Fix all Bluetooth modules to provide current maintainer information. Signed-off-by: Marcel Holtmann <[email protected]>
2008-08-18[Bluetooth] Fix userspace breakage due missing class linksMarcel Holtmann1-187/+189
The Bluetooth adapters and connections are best presented via a class in sysfs. The removal of the links inside the Bluetooth class broke assumptions by userspace programs on how to find attached adapters. This patch creates adapters and connections as part of the Bluetooth class, but it uses different device types to distinguish them. The userspace programs can now easily navigate in the sysfs device tree. The unused platform device and bus have been removed to keep the code simple and clean. Signed-off-by: Marcel Holtmann <[email protected]>
2008-08-18pkt_sched: Fix return value corruption in HTB and TBF.David S. Miller2-11/+4
Based upon a bug report by Josip Rodin. Packet schedulers should only return NET_XMIT_DROP iff the packet really was dropped. If the packet does reach the device after we return NET_XMIT_DROP then TCP can crash because it depends upon the enqueue path return values being accurate. Signed-off-by: David S. Miller <[email protected]>
2008-08-17pkt_sched: Fix missed RCU unlock in dev_queue_xmit()David S. Miller1-6/+4
Noticed by Jarek Poplawski. Signed-off-by: David S. Miller <[email protected]>
2008-08-17ipv6: Fix the return interface index when get it while no message is received.Yang Hongyang1-2/+2
When get receiving interface index while no message is received, the bounded device's index of the socket should be returned. RFC 3542: Issuing getsockopt() for the above options will return the sticky option value i.e., the value set with setsockopt(). If no sticky option value has been set getsockopt() will return the following values: - For the IPV6_PKTINFO option, it will return an in6_pktinfo structure with ipi6_addr being in6addr_any and ipi6_ifindex being zero. Signed-off-by: Yang Hongyang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-08-17sch_prio: Use NET_XMIT_SUCCESS instead of "0" constant.David S. Miller1-1/+1
Signed-off-by: David S. Miller <[email protected]>
2008-08-17sch_prio: Use return value from inner qdisc requeueJussi Kivilinna1-1/+1
Use return value from inner qdisc requeue when value returned isn't NET_XMIT_SUCCESS, instead of always returning NET_XMIT_DROP. Signed-off-by: Jussi Kivilinna <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2008-08-17pkt_sched: No longer destroy qdiscs from RCU.David S. Miller1-18/+9
We can now kill them synchronously with all of the previous dev_deactivate() cures. This makes netdev destruction and shutdown saner as the qdiscs hold references to the device. Signed-off-by: David S. Miller <[email protected]>