aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-04-12 17:04:33 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-04-12 17:04:33 -0400
commit174808af90a06ee59ffedd60c00c252f1f887f25 (patch)
tree5e026fdc0d2b4d66c0a79267e5755e10d6d04bd8 /include
parent778c2dee6f134bf0472ed45eedaee53b4f336afb (diff)
parent5d949944229b0a08e218723be231731cd86b94f3 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) Fix bluetooth userland regression reported by Keith Packard, from Gustavo Padovan. 2) Revert ath9k PS idle change, from Sujith Manoharan. 3) Correct default TCP memory limits (again), from Eric Dumazet. 4) Fix tcp_rcv_rtt_update() accidental use of unscaled RTT, from Neal Cardwell. 5) We made a facility for layers like wireless to say how much tailroom they need in the SKB for link layer stuff such as wireless encryption etc., but TCP works hard to fill every SKB out to the end defeating this specification. This leads to every TCP packet getting reallocated by the wireless code in order to have the right amount of tailroom available. Fix TCP to only fill SKBs out to the real amount of data area it asked for during the allocation, this way it won't eat into the slack added for the device's tailroom needs. Reported by Marc Merlin and fixed by Eric Dumazet. 6) Leaks, endian bugs, and new device IDs in bluetooth from Santosh Nayak, João Paulo Rechi Vita, Cho, Yu-Chen, Andrei Emeltchenko, AceLan Kao, and Andrei Emeltchenko. 7) OOPS on tty_close fix in bluetooth's hci_ldisc from Johan Hovold. 8) netfilter erroneously scales TCP window twice, fix from Changli Gao. 9) Memleak fix in wext-core from Julia Lawall. 10) Consistently handle invalid TCP packets in ipv4 vs. ipv6 conntrack, from Jozsef Kadlecsik. 11) Validate IP header length properly in netfilter conntrack's ipv4_get_l4proto(). * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (39 commits) NFC: Fix the LLCP Tx fragmentation loop rtlwifi: Add missing DMA buffer unmapping for PCI drivers rtlwifi: Preallocate USB read buffers and eliminate kalloc in read routine tcp: avoid order-1 allocations on wifi and tx path net: allow pskb_expand_head() to get maximum tailroom bridge: Do not send queries on multicast group leaves MAINTAINERS: Mark NATSEMI driver as orphan'd. tcp: fix tcp_rcv_rtt_update() use of an unscaled RTT sample tcp: restore correct limit Revert "ath9k: fix going to full-sleep on PS idle" rt2x00: Fix rfkill_polling register function. bcma: fix build error on MIPS; implicit pcibios_enable_device netfilter: nf_conntrack: fix incorrect logic in nf_conntrack_init_net netfilter: nf_ct_ipv4: packets with wrong ihl are invalid netfilter: nf_ct_ipv4: handle invalid IPv4 and IPv6 packets consistently net/wireless/wext-core.c: add missing kfree rtlwifi: Fix oops on rate-control failure mac80211: Convert WARN_ON to WARN_ON_ONCE rtlwifi: rtl8192de: Fix firmware initialization nl80211: ensure interface is up in various APIs ...
Diffstat (limited to 'include')
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h12
-rw-r--r--include/linux/skbuff.h13
-rw-r--r--include/net/bluetooth/hci.h3
-rw-r--r--include/net/bluetooth/hci_core.h12
-rw-r--r--include/net/bluetooth/mgmt.h2
-rw-r--r--include/net/mac80211.h2
6 files changed, 35 insertions, 9 deletions
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index f549adccc94..1bc898b14a8 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -287,7 +287,17 @@ extern unsigned int ip6t_do_table(struct sk_buff *skb,
287 struct xt_table *table); 287 struct xt_table *table);
288 288
289/* Check for an extension */ 289/* Check for an extension */
290extern int ip6t_ext_hdr(u8 nexthdr); 290static inline int
291ip6t_ext_hdr(u8 nexthdr)
292{ return (nexthdr == IPPROTO_HOPOPTS) ||
293 (nexthdr == IPPROTO_ROUTING) ||
294 (nexthdr == IPPROTO_FRAGMENT) ||
295 (nexthdr == IPPROTO_ESP) ||
296 (nexthdr == IPPROTO_AH) ||
297 (nexthdr == IPPROTO_NONE) ||
298 (nexthdr == IPPROTO_DSTOPTS);
299}
300
291/* find specified header and get offset to it */ 301/* find specified header and get offset to it */
292extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, 302extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
293 int target, unsigned short *fragoff); 303 int target, unsigned short *fragoff);
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 33370271b8b..70a3f8d4911 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -481,6 +481,7 @@ struct sk_buff {
481 union { 481 union {
482 __u32 mark; 482 __u32 mark;
483 __u32 dropcount; 483 __u32 dropcount;
484 __u32 avail_size;
484 }; 485 };
485 486
486 sk_buff_data_t transport_header; 487 sk_buff_data_t transport_header;
@@ -1366,6 +1367,18 @@ static inline int skb_tailroom(const struct sk_buff *skb)
1366} 1367}
1367 1368
1368/** 1369/**
1370 * skb_availroom - bytes at buffer end
1371 * @skb: buffer to check
1372 *
1373 * Return the number of bytes of free space at the tail of an sk_buff
1374 * allocated by sk_stream_alloc()
1375 */
1376static inline int skb_availroom(const struct sk_buff *skb)
1377{
1378 return skb_is_nonlinear(skb) ? 0 : skb->avail_size - skb->len;
1379}
1380
1381/**
1369 * skb_reserve - adjust headroom 1382 * skb_reserve - adjust headroom
1370 * @skb: buffer to alter 1383 * @skb: buffer to alter
1371 * @len: bytes to move 1384 * @len: bytes to move
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 344b0f97282..d47e523c9d8 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -92,6 +92,7 @@ enum {
92 HCI_SERVICE_CACHE, 92 HCI_SERVICE_CACHE,
93 HCI_LINK_KEYS, 93 HCI_LINK_KEYS,
94 HCI_DEBUG_KEYS, 94 HCI_DEBUG_KEYS,
95 HCI_UNREGISTER,
95 96
96 HCI_LE_SCAN, 97 HCI_LE_SCAN,
97 HCI_SSP_ENABLED, 98 HCI_SSP_ENABLED,
@@ -1327,8 +1328,8 @@ struct sockaddr_hci {
1327#define HCI_DEV_NONE 0xffff 1328#define HCI_DEV_NONE 0xffff
1328 1329
1329#define HCI_CHANNEL_RAW 0 1330#define HCI_CHANNEL_RAW 0
1330#define HCI_CHANNEL_CONTROL 1
1331#define HCI_CHANNEL_MONITOR 2 1331#define HCI_CHANNEL_MONITOR 2
1332#define HCI_CHANNEL_CONTROL 3
1332 1333
1333struct hci_filter { 1334struct hci_filter {
1334 unsigned long type_mask; 1335 unsigned long type_mask;
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index daefaac5113..6822d2595af 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -427,7 +427,7 @@ enum {
427static inline bool hci_conn_ssp_enabled(struct hci_conn *conn) 427static inline bool hci_conn_ssp_enabled(struct hci_conn *conn)
428{ 428{
429 struct hci_dev *hdev = conn->hdev; 429 struct hci_dev *hdev = conn->hdev;
430 return (test_bit(HCI_SSP_ENABLED, &hdev->flags) && 430 return (test_bit(HCI_SSP_ENABLED, &hdev->dev_flags) &&
431 test_bit(HCI_CONN_SSP_ENABLED, &conn->flags)); 431 test_bit(HCI_CONN_SSP_ENABLED, &conn->flags));
432} 432}
433 433
@@ -907,11 +907,13 @@ static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status,
907 907
908static inline bool eir_has_data_type(u8 *data, size_t data_len, u8 type) 908static inline bool eir_has_data_type(u8 *data, size_t data_len, u8 type)
909{ 909{
910 u8 field_len; 910 size_t parsed = 0;
911 size_t parsed;
912 911
913 for (parsed = 0; parsed < data_len - 1; parsed += field_len) { 912 if (data_len < 2)
914 field_len = data[0]; 913 return false;
914
915 while (parsed < data_len - 1) {
916 u8 field_len = data[0];
915 917
916 if (field_len == 0) 918 if (field_len == 0)
917 break; 919 break;
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index ffc1377e092..ebfd91fc20f 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -117,7 +117,7 @@ struct mgmt_mode {
117#define MGMT_OP_SET_DISCOVERABLE 0x0006 117#define MGMT_OP_SET_DISCOVERABLE 0x0006
118struct mgmt_cp_set_discoverable { 118struct mgmt_cp_set_discoverable {
119 __u8 val; 119 __u8 val;
120 __u16 timeout; 120 __le16 timeout;
121} __packed; 121} __packed;
122#define MGMT_SET_DISCOVERABLE_SIZE 3 122#define MGMT_SET_DISCOVERABLE_SIZE 3
123 123
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 87d203ff7a8..9210bdc7bd8 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1327,7 +1327,7 @@ static inline struct ieee80211_rate *
1327ieee80211_get_tx_rate(const struct ieee80211_hw *hw, 1327ieee80211_get_tx_rate(const struct ieee80211_hw *hw,
1328 const struct ieee80211_tx_info *c) 1328 const struct ieee80211_tx_info *c)
1329{ 1329{
1330 if (WARN_ON(c->control.rates[0].idx < 0)) 1330 if (WARN_ON_ONCE(c->control.rates[0].idx < 0))
1331 return NULL; 1331 return NULL;
1332 return &hw->wiphy->bands[c->band]->bitrates[c->control.rates[0].idx]; 1332 return &hw->wiphy->bands[c->band]->bitrates[c->control.rates[0].idx];
1333} 1333}