aboutsummaryrefslogtreecommitdiff
path: root/net
AgeCommit message (Collapse)AuthorFilesLines
2010-07-26cfg80211: fix IBSS default management keyJohannes Berg1-1/+3
When wireless extensions are used to control an encrypted IBSS, we erroneously can try to set the default management key. Fix this. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2010-07-26mac80211: remove bogus rcu_read_lock()Johannes Berg1-6/+1
Another remnant of the previous key locking scheme needs to be removed -- this causes a warning otherwise as ieee80211_set_default_mgmt_key will acquire a mutex. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2010-07-26wireless: remove unneeded variable from regulatory_hint_11d()Dan Carpenter1-4/+1
The "rd" variable isn't needed any more since 4f366c5dabcb "wireless: only use alpha2 regulatory information from country IE" Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2010-07-26mac80211: freeing the wrong variableDan Carpenter1-1/+1
The intent was to free "msp->ratelist" here. "msp->sample_table" is always NULL at this point. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2010-07-26lib80211: remove unused host_build_iv optionJohn W. Linville3-3/+0
Signed-off-by: John W. Linville <[email protected]>
2010-07-26minstrel: don't complain about feedback for unrequested ratesJohn W. Linville1-1/+0
"It's not problematic if minstrel gets feedback for rates that it doesn't have in its list, it should just ignore it. - Felix" Signed-off-by: John W. Linville <[email protected]> Cc: Felix Fietkau <[email protected]>
2010-07-26minstrel_ht: remove unnecessary NULL check in minstrel_ht_update_capsJohn W. Linville1-1/+1
If sta is NULL, we will have problems long before we get here... Reported-by: Dan Carpenter <[email protected]> Signed-off-by: John W. Linville <[email protected]> Cc: Felix Fietkau <[email protected]>
2010-07-25net: dev_forward_skb should call nf_resetBen Greear1-0/+1
With conn-track zones and probably with different network namespaces, the netfilter logic needs to be re-calculated on packet receive. If the netfilter logic is not reset, it will not be recalculated properly. This patch adds the nf_reset logic to dev_forward_skb. Signed-off-by: Ben Greear <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2010-07-24net: pskb_expand_head() optimizationEric Dumazet1-1/+1
Move frags[] at the end of struct skb_shared_info, and make pskb_expand_head() copy only the used part of it instead of whole array. This should avoid kmemcheck warnings and speedup pskb_expand_head() as well, avoiding a lot of cache misses. Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2010-07-24net sched: fix race in mirred device removalstephen hemminger1-3/+40
This fixes hang when target device of mirred packet classifier action is removed. If a mirror or redirection action is configured to cause packets to go to another device, the classifier holds a ref count, but was assuming the adminstrator cleaned up all redirections before removing. The fix is to add a notifier and cleanup during unregister. The new list is implicitly protected by RTNL mutex because it is held during filter add/delete as well as notifier. Signed-off-by: Stephen Hemminger <[email protected]> Acked-by: Jamal Hadi Salim <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2010-07-24sysfs: add attribute to indicate hw address assignment typeStefan Assmann1-0/+2
Add addr_assign_type to struct net_device and expose it via sysfs. This new attribute has the purpose of giving user-space the ability to distinguish between different assignment types of MAC addresses. For example user-space can treat NICs with randomly generated MAC addresses differently than NICs that have permanent (locally assigned) MAC addresses. For the former udev could write a persistent net rule by matching the device path instead of the MAC address. There's also the case of devices that 'steal' MAC addresses from slave devices. In which it is also be beneficial for user-space to be aware of the fact. This patch also introduces a helper function to assist adoption of drivers that generate MAC addresses randomly. Signed-off-by: Stefan Assmann <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2010-07-23Merge branch 'master' of ↵David S. Miller15-717/+98
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 Conflicts: drivers/net/wireless/iwlwifi/iwl-commands.h
2010-07-23net: core: don't use own hex_to_bin() methodAndy Shevchenko1-24/+12
Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2010-07-23netfilter: iptables: use skb->len for accountingChangli Gao1-1/+1
Use skb->len for accounting as xt_quota does. Signed-off-by: Changli Gao <[email protected]> Signed-off-by: Patrick McHardy <[email protected]>
2010-07-23netfilter: ip6tables: use skb->len for accountingChangli Gao1-3/+1
ipv6_hdr(skb)->payload_len is ZERO and can't be used for accounting, if the payload is a Jumbo Payload specified in RFC2675. Signed-off-by: Changli Gao <[email protected]> Signed-off-by: Patrick McHardy <[email protected]>
2010-07-23xt_quota: report initial quota value instead of current value to userspaceChangli Gao1-2/+0
We should copy the initial value to userspace for iptables-save and to allow removal of specific quota rules. Signed-off-by: Changli Gao <[email protected]> Signed-off-by: Patrick McHardy <[email protected]>
2010-07-23netfilter: xt_quota: use per-rule spin lockChangli Gao1-5/+5
Use per-rule spin lock to improve the scalability. Signed-off-by: Changli Gao <[email protected]> Signed-off-by: Patrick McHardy <[email protected]>
2010-07-23netfilter: arptables: use arp_hdr_len()Changli Gao1-4/+1
use arp_hdr_len(). Signed-off-by: Changli Gao <[email protected]> Signed-off-by: Patrick McHardy <[email protected]>
2010-07-23netfilter: nf_nat_core: merge the same linesChangli Gao1-7/+2
proto->unique_tuple() will be called finally, if the previous calls fail. This patch checks the false condition of (range->flags &IP_NAT_RANGE_PROTO_RANDOM) instead to avoid duplicate line of code: proto->unique_tuple(). Signed-off-by: Changli Gao <[email protected]> Signed-off-by: Patrick McHardy <[email protected]>
2010-07-23netfilter: add xt_cpu matchEric Dumazet3-0/+73
In some situations a CPU match permits a better spreading of connections, or select targets only for a given cpu. With Remote Packet Steering or multiqueue NIC and appropriate IRQ affinities, we can distribute trafic on available cpus, per session. (all RX packets for a given flow is handled by a given cpu) Some legacy applications being not SMP friendly, one way to scale a server is to run multiple copies of them. Instead of randomly choosing an instance, we can use the cpu number as a key so that softirq handler for a whole instance is running on a single cpu, maximizing cache effects in TCP/UDP stacks. Using NAT for example, a four ways machine might run four copies of server application, using a separate listening port for each instance, but still presenting an unique external port : iptables -t nat -A PREROUTING -p tcp --dport 80 -m cpu --cpu 0 \ -j REDIRECT --to-port 8080 iptables -t nat -A PREROUTING -p tcp --dport 80 -m cpu --cpu 1 \ -j REDIRECT --to-port 8081 iptables -t nat -A PREROUTING -p tcp --dport 80 -m cpu --cpu 2 \ -j REDIRECT --to-port 8082 iptables -t nat -A PREROUTING -p tcp --dport 80 -m cpu --cpu 3 \ -j REDIRECT --to-port 8083 Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: Patrick McHardy <[email protected]>
2010-07-23IPVS: make FTP work with full NAT supportHannes Eder4-57/+165
Use nf_conntrack/nf_nat code to do the packet mangling and the TCP sequence adjusting. The function 'ip_vs_skb_replace' is now dead code, so it is removed. To SNAT FTP, use something like: % iptables -t nat -A POSTROUTING -m ipvs --vaddr 192.168.100.30/32 \ --vport 21 -j SNAT --to-source 192.168.10.10 and for the data connections in passive mode: % iptables -t nat -A POSTROUTING -m ipvs --vaddr 192.168.100.30/32 \ --vportctl 21 -j SNAT --to-source 192.168.10.10 using '-m state --state RELATED' would also works. Make sure the kernel modules ip_vs_ftp, nf_conntrack_ftp, and nf_nat_ftp are loaded. [ up-port and minor fixes by Simon Horman <[email protected]> ] Signed-off-by: Hannes Eder <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: Patrick McHardy <[email protected]>
2010-07-23IPVS: make friends with nf_conntrackHannes Eder3-37/+30
Update the nf_conntrack tuple in reply direction, as we will see traffic from the real server (RIP) to the client (CIP). Once this is done we can use netfilters SNAT in POSTROUTING, especially with xt_ipvs, to do source NAT, e.g.: % iptables -t nat -A POSTROUTING -m ipvs --vaddr 192.168.100.30/32 --vport 80 \ -j SNAT --to-source 192.168.10.10 [ minor fixes by Simon Horman <[email protected]> ] Signed-off-by: Hannes Eder <[email protected]> Signed-off-by: Simon Horman <[email protected]> Signed-off-by: Patrick McHardy <[email protected]>
2010-07-23netfilter: xt_ipvs (netfilter matcher for IPVS)Hannes Eder4-0/+201
This implements the kernel-space side of the netfilter matcher xt_ipvs. [ minor fixes by Simon Horman <[email protected]> ] Signed-off-by: Hannes Eder <[email protected]> Signed-off-by: Simon Horman <[email protected]> [ Patrick: added xt_ipvs.h to Kbuild ] Signed-off-by: Patrick McHardy <[email protected]>
2010-07-22caif: precedence bugDan Carpenter1-1/+1
Negate has precedence over comparison so the original assert only checked that "rfml->fragment_size" was larger than 1 or 0. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2010-07-22net: RTA_MARK additionEric Dumazet1-0/+7
Add a new rt attribute, RTA_MARK, and use it in rt_fill_info()/inet_rtm_getroute() to support following commands : ip route get 192.168.20.110 mark NUMBER ip route get 192.168.20.108 from 192.168.20.110 iif eth1 mark NUMBER ip route list cache [192.168.20.110] mark NUMBER Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2010-07-22ipv6: Don't add routes to ipv6 disabled interfaces.Brian Haley1-5/+9
If the interface has IPv6 disabled, don't add a multicast or link-local route since we won't be adding a link-local address. Reported-by: Mahesh Kelkar <[email protected]> Signed-off-by: Brian Haley <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2010-07-22net: Fix skb_copy_expand() handling of ->csum_startDavid S. Miller1-1/+2
It should only be adjusted if ip_summed == CHECKSUM_PARTIAL. Signed-off-by: David S. Miller <[email protected]>
2010-07-22net: Fix corruption of skb csum field in pskb_expand_head() of net/core/skbuff.cAndrea Shepard1-1/+3
Make pskb_expand_head() check ip_summed to make sure csum_start is really csum_start and not csum before adjusting it. This fixes a bug I encountered using a Sun Quad-Fast Ethernet card and VLANs. On my configuration, the sunhme driver produces skbs with differing amounts of headroom on receive depending on the packet size. See line 2030 of drivers/net/sunhme.c; packets smaller than RX_COPY_THRESHOLD have 52 bytes of headroom but packets larger than that cutoff have only 20 bytes. When these packets reach the VLAN driver, vlan_check_reorder_header() calls skb_cow(), which, if the packet has less than NET_SKB_PAD (== 32) bytes of headroom, uses pskb_expand_head() to make more. Then, pskb_expand_head() needs to adjust a lot of offsets into the skb, including csum_start. Since csum_start is a union with csum, if the packet has a valid csum value this will corrupt it, which was the effect I observed. The sunhme hardware computes receive checksums, so the skbs would be created by the driver with ip_summed == CHECKSUM_COMPLETE and a valid csum field, and then pskb_expand_head() would corrupt the csum field, leading to an "hw csum error" message later on, for example in icmp_rcv() for pings larger than the sunhme RX_COPY_THRESHOLD. On the basis of the comment at the beginning of include/linux/skbuff.h, I believe that the csum_start skb field is only meaningful if ip_csummed is CSUM_PARTIAL, so this patch makes pskb_expand_head() adjust it only in that case to avoid corrupting a valid csum value. Please see my more in-depth disucssion of tracking down this bug for more details if you like: http://puellavulnerata.livejournal.com/112186.html http://puellavulnerata.livejournal.com/112567.html http://puellavulnerata.livejournal.com/112891.html http://puellavulnerata.livejournal.com/113096.html http://puellavulnerata.livejournal.com/113591.html I am not subscribed to this list, so please CC me on replies. Signed-off-by: Andrea Shepard <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2010-07-21net: remove last uses of __attribute__((packed))Gustavo F. Padovan1-1/+1
Network code uses the __packed macro instead of __attribute__((packed)). Signed-off-by: Gustavo F. Padovan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2010-07-21mac80211: proper IBSS lockingJohannes Berg2-50/+54
IBSS has never had locking, instead relying on some memory barriers etc. That's hard to get right, and I think we had it wrong too until the previous patch. Since this is not performance sensitive, it doesn't make sense to have the maintenance overhead of that, so add proper locking. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2010-07-21mac80211: fix IBSS lockdep complaintJohannes Berg1-5/+14
Bob reported a lockdep complaint originating in the mac80211 IBSS code due to the common work struct patch. The reason is that the IBSS and station mode code have different locking orders for the cfg80211 wdev lock and the work struct (where "locking" implies running/canceling). Fix this by simply not canceling the work in the IBSS code, it is not necessary since when the REQ_RUN bit is cleared, the work will run without effect if it runs. When the interface is set down, it is flushed anyway, so there's no concern about it running after memory has been invalidated either. This fixes https://bugzilla.kernel.org/show_bug.cgi?id=16419 Additionally, looking into this I noticed that there's a small window while the IBSS is torn down in which the work may be rescheduled and the REQ_RUN bit be set again after leave() has cleared it when a scan finishes at exactly the same time. Avoid that by setting the ssid_len to zero before clearing REQ_RUN which signals to the scan finish code that this interface is not active. Reported-by: Bob Copeland <[email protected]> Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2010-07-21mac80211: refuse shared key auth when WEP is unavailableJohannes Berg1-0/+2
When WEP is not available, we should reject shared key authentication because it could never succeed. Signed-off-by: Johannes Berg <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2010-07-21cfg80211: fix race between sysfs and cfg80211Maxime Bizon1-6/+8
device_add() is called before adding the phy to the cfg80211 device list. So if a userspace program uses sysfs uevents to detect new phy devices, and queries nl80211 to get phy info, it can get ENODEV even though the phy exists in sysfs. An easy workaround is to hold the cfg80211 mutex until the phy is present in sysfs/cfg80211/debugfs. Signed-off-by: Maxime Bizon <[email protected]> Signed-off-by: John W. Linville <[email protected]>
2010-07-21Bluetooth: Enable L2CAP Extended features by defaultGustavo F. Padovan1-9/+9
Change the enable_ertm param to disable_ertm and default value to 0. That means that L2CAP Extended features are enabled by default now. Signed-off-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Fix typo in hci_event.cGustavo F. Padovan1-2/+2
memmory -> memory Signed-off-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Add Google's copyright to L2CAPGustavo F. Padovan1-0/+1
Signed-off-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Implemented HCI frame reassembly for RX from streamSuraj Sumangala1-0/+35
Implemented frame reassembly implementation for reassembling fragments received from stream. Signed-off-by: Suraj Sumangala <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Modified hci_recv_fragment() to use hci_reassembly helperSuraj Sumangala1-74/+11
Modified packet based reassembly function hci_recv_fragment() to use hci_reassembly() Signed-off-by: Suraj Sumangala <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Implement hci_reassembly helper to reassemble RX packetsSuraj Sumangala1-0/+109
Implements feature to reassemble received HCI frames from any input stream Signed-off-by: Suraj Sumangala <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Add one more buffer for HCI stream reassemblySuraj Sumangala1-3/+3
Additional reassembly buffer to keep track of stream reasembly Signed-off-by: Suraj Sumangala <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Update L2CAP version informationGustavo F. Padovan1-1/+1
We did some changes on the L2CAP configuration process and its behaviour is bit different now. That justifies a updated on the L2CAP version. Signed-off-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Add Copyright notice to L2CAPGustavo F. Padovan1-0/+1
Copyright for the time I worked on L2CAP during the Google Summer of Code program. Signed-off-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Keep code under column 80Gustavo F. Padovan1-21/+25
Purely a cosmetic change, it doesn't change the code flow. Signed-off-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Fix bug in kzalloc allocation sizeGustavo F. Padovan1-1/+1
Probably a typo error. We were using the wrong struct to get size. Signed-off-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Send ConfigReq after send a ConnectionRspGustavo F. Padovan1-3/+41
The extended L2CAP features requires that one should initiate a ConfigReq after send the ConnectionRsp. This patch changes the behaviour of the configuration process of our stack. Signed-off-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Fix error return on L2CAP-HCI interface.João Paulo Rechi Vita1-3/+3
L2CAP only deals with ACL links. EINVAL should be returned otherwise. Signed-off-by: João Paulo Rechi Vita <[email protected]> Acked-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Fix error value for wrong FCS.João Paulo Rechi Vita1-1/+1
Signed-off-by: João Paulo Rechi Vita <[email protected]> Acked-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Fix error return for l2cap_connect_rsp().João Paulo Rechi Vita1-2/+2
Signed-off-by: João Paulo Rechi Vita <[email protected]> Acked-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Fix error return value on sendmsg.João Paulo Rechi Vita1-1/+1
When the socket is in a bad state EBADFD is more appropriate then EINVAL. Signed-off-by: João Paulo Rechi Vita <[email protected]> Acked-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
2010-07-21Bluetooth: Fix error return value on sendmsg.João Paulo Rechi Vita1-1/+1
When we try to send a message bigger than the outgoing MTU value EMSGSIZE (message too long) should be returned. Signed-off-by: João Paulo Rechi Vita <[email protected]> Acked-by: Gustavo F. Padovan <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>