aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
Diffstat (limited to 'net')
-rw-r--r--net/core/netpoll.c2
-rw-r--r--net/core/sock.c2
-rw-r--r--net/econet/af_econet.c2
-rw-r--r--net/ipv4/arp.c2
-rw-r--r--net/ipv4/cipso_ipv4.c4
-rw-r--r--net/ipv4/igmp.c4
-rw-r--r--net/ipv4/ipconfig.c6
-rw-r--r--net/ipv4/raw.c10
-rw-r--r--net/ipv4/tcp_input.c17
-rw-r--r--net/ipv6/ip6_output.c2
-rw-r--r--net/ipv6/mcast.c4
-rw-r--r--net/ipv6/ndisc.c4
-rw-r--r--net/ipv6/raw.c10
-rw-r--r--net/irda/discovery.c8
-rw-r--r--net/irda/irlmp.c5
-rw-r--r--net/irda/irnet/irnet_irda.c4
-rw-r--r--net/mac80211/debugfs_key.c15
-rw-r--r--net/mac80211/iface.c9
-rw-r--r--net/mac80211/mesh.c2
-rw-r--r--net/mac80211/mesh_hwmp.c2
-rw-r--r--net/mac80211/mesh_pathtbl.c17
-rw-r--r--net/mac80211/mlme.c64
-rw-r--r--net/mac80211/rx.c12
-rw-r--r--net/mac80211/tx.c5
-rw-r--r--net/mac80211/util.c10
-rw-r--r--net/mac80211/wme.c3
-rw-r--r--net/netfilter/nf_conntrack_netlink.c3
-rw-r--r--net/netfilter/xt_iprange.c2
-rw-r--r--net/packet/af_packet.c2
-rw-r--r--net/sctp/sm_make_chunk.c16
-rw-r--r--net/xfrm/xfrm_output.c6
31 files changed, 171 insertions, 83 deletions
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index b04d643fc3c7..8fb134da0346 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -419,7 +419,7 @@ static void arp_reply(struct sk_buff *skb)
419 return; 419 return;
420 420
421 size = arp_hdr_len(skb->dev); 421 size = arp_hdr_len(skb->dev);
422 send_skb = find_skb(np, size + LL_RESERVED_SPACE(np->dev), 422 send_skb = find_skb(np, size + LL_ALLOCATED_SPACE(np->dev),
423 LL_RESERVED_SPACE(np->dev)); 423 LL_RESERVED_SPACE(np->dev));
424 424
425 if (!send_skb) 425 if (!send_skb)
diff --git a/net/core/sock.c b/net/core/sock.c
index fa76f04fa9c6..88094cb09c06 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -270,7 +270,7 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
270 int err = 0; 270 int err = 0;
271 int skb_len; 271 int skb_len;
272 272
273 /* Cast skb->rcvbuf to unsigned... It's pointless, but reduces 273 /* Cast sk->rcvbuf to unsigned... It's pointless, but reduces
274 number of warnings when compiling with -W --ANK 274 number of warnings when compiling with -W --ANK
275 */ 275 */
276 if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >= 276 if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >=
diff --git a/net/econet/af_econet.c b/net/econet/af_econet.c
index 68d154480043..7c9bb13b1539 100644
--- a/net/econet/af_econet.c
+++ b/net/econet/af_econet.c
@@ -340,7 +340,7 @@ static int econet_sendmsg(struct kiocb *iocb, struct socket *sock,
340 340
341 dev_hold(dev); 341 dev_hold(dev);
342 342
343 skb = sock_alloc_send_skb(sk, len+LL_RESERVED_SPACE(dev), 343 skb = sock_alloc_send_skb(sk, len+LL_ALLOCATED_SPACE(dev),
344 msg->msg_flags & MSG_DONTWAIT, &err); 344 msg->msg_flags & MSG_DONTWAIT, &err);
345 if (skb==NULL) 345 if (skb==NULL)
346 goto out_unlock; 346 goto out_unlock;
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index 68b72a7a1806..418862f1bf22 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -570,7 +570,7 @@ struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip,
570 * Allocate a buffer 570 * Allocate a buffer
571 */ 571 */
572 572
573 skb = alloc_skb(arp_hdr_len(dev) + LL_RESERVED_SPACE(dev), GFP_ATOMIC); 573 skb = alloc_skb(arp_hdr_len(dev) + LL_ALLOCATED_SPACE(dev), GFP_ATOMIC);
574 if (skb == NULL) 574 if (skb == NULL)
575 return NULL; 575 return NULL;
576 576
diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c
index 05afb576d935..2c0e4572cc90 100644
--- a/net/ipv4/cipso_ipv4.c
+++ b/net/ipv4/cipso_ipv4.c
@@ -338,7 +338,7 @@ static int cipso_v4_cache_check(const unsigned char *key,
338 return -ENOENT; 338 return -ENOENT;
339 339
340 hash = cipso_v4_map_cache_hash(key, key_len); 340 hash = cipso_v4_map_cache_hash(key, key_len);
341 bkt = hash & (CIPSO_V4_CACHE_BUCKETBITS - 1); 341 bkt = hash & (CIPSO_V4_CACHE_BUCKETS - 1);
342 spin_lock_bh(&cipso_v4_cache[bkt].lock); 342 spin_lock_bh(&cipso_v4_cache[bkt].lock);
343 list_for_each_entry(entry, &cipso_v4_cache[bkt].list, list) { 343 list_for_each_entry(entry, &cipso_v4_cache[bkt].list, list) {
344 if (entry->hash == hash && 344 if (entry->hash == hash &&
@@ -417,7 +417,7 @@ int cipso_v4_cache_add(const struct sk_buff *skb,
417 atomic_inc(&secattr->cache->refcount); 417 atomic_inc(&secattr->cache->refcount);
418 entry->lsm_data = secattr->cache; 418 entry->lsm_data = secattr->cache;
419 419
420 bkt = entry->hash & (CIPSO_V4_CACHE_BUCKETBITS - 1); 420 bkt = entry->hash & (CIPSO_V4_CACHE_BUCKETS - 1);
421 spin_lock_bh(&cipso_v4_cache[bkt].lock); 421 spin_lock_bh(&cipso_v4_cache[bkt].lock);
422 if (cipso_v4_cache[bkt].size < cipso_v4_cache_bucketsize) { 422 if (cipso_v4_cache[bkt].size < cipso_v4_cache_bucketsize) {
423 list_add(&entry->list, &cipso_v4_cache[bkt].list); 423 list_add(&entry->list, &cipso_v4_cache[bkt].list);
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 6250f4239b61..2769dc4a4c84 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -292,7 +292,7 @@ static struct sk_buff *igmpv3_newpack(struct net_device *dev, int size)
292 struct iphdr *pip; 292 struct iphdr *pip;
293 struct igmpv3_report *pig; 293 struct igmpv3_report *pig;
294 294
295 skb = alloc_skb(size + LL_RESERVED_SPACE(dev), GFP_ATOMIC); 295 skb = alloc_skb(size + LL_ALLOCATED_SPACE(dev), GFP_ATOMIC);
296 if (skb == NULL) 296 if (skb == NULL)
297 return NULL; 297 return NULL;
298 298
@@ -653,7 +653,7 @@ static int igmp_send_report(struct in_device *in_dev, struct ip_mc_list *pmc,
653 return -1; 653 return -1;
654 } 654 }
655 655
656 skb=alloc_skb(IGMP_SIZE+LL_RESERVED_SPACE(dev), GFP_ATOMIC); 656 skb=alloc_skb(IGMP_SIZE+LL_ALLOCATED_SPACE(dev), GFP_ATOMIC);
657 if (skb == NULL) { 657 if (skb == NULL) {
658 ip_rt_put(rt); 658 ip_rt_put(rt);
659 return -1; 659 return -1;
diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c
index 89dee4346f60..ed45037ce9be 100644
--- a/net/ipv4/ipconfig.c
+++ b/net/ipv4/ipconfig.c
@@ -710,14 +710,14 @@ static void __init ic_bootp_send_if(struct ic_device *d, unsigned long jiffies_d
710 struct net_device *dev = d->dev; 710 struct net_device *dev = d->dev;
711 struct sk_buff *skb; 711 struct sk_buff *skb;
712 struct bootp_pkt *b; 712 struct bootp_pkt *b;
713 int hh_len = LL_RESERVED_SPACE(dev);
714 struct iphdr *h; 713 struct iphdr *h;
715 714
716 /* Allocate packet */ 715 /* Allocate packet */
717 skb = alloc_skb(sizeof(struct bootp_pkt) + hh_len + 15, GFP_KERNEL); 716 skb = alloc_skb(sizeof(struct bootp_pkt) + LL_ALLOCATED_SPACE(dev) + 15,
717 GFP_KERNEL);
718 if (!skb) 718 if (!skb)
719 return; 719 return;
720 skb_reserve(skb, hh_len); 720 skb_reserve(skb, LL_RESERVED_SPACE(dev));
721 b = (struct bootp_pkt *) skb_put(skb, sizeof(struct bootp_pkt)); 721 b = (struct bootp_pkt *) skb_put(skb, sizeof(struct bootp_pkt));
722 memset(b, 0, sizeof(struct bootp_pkt)); 722 memset(b, 0, sizeof(struct bootp_pkt));
723 723
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 11d7f753a820..fead049daf43 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -322,7 +322,6 @@ static int raw_send_hdrinc(struct sock *sk, void *from, size_t length,
322 unsigned int flags) 322 unsigned int flags)
323{ 323{
324 struct inet_sock *inet = inet_sk(sk); 324 struct inet_sock *inet = inet_sk(sk);
325 int hh_len;
326 struct iphdr *iph; 325 struct iphdr *iph;
327 struct sk_buff *skb; 326 struct sk_buff *skb;
328 unsigned int iphlen; 327 unsigned int iphlen;
@@ -336,13 +335,12 @@ static int raw_send_hdrinc(struct sock *sk, void *from, size_t length,
336 if (flags&MSG_PROBE) 335 if (flags&MSG_PROBE)
337 goto out; 336 goto out;
338 337
339 hh_len = LL_RESERVED_SPACE(rt->u.dst.dev); 338 skb = sock_alloc_send_skb(sk,
340 339 length + LL_ALLOCATED_SPACE(rt->u.dst.dev) + 15,
341 skb = sock_alloc_send_skb(sk, length+hh_len+15, 340 flags & MSG_DONTWAIT, &err);
342 flags&MSG_DONTWAIT, &err);
343 if (skb == NULL) 341 if (skb == NULL)
344 goto error; 342 goto error;
345 skb_reserve(skb, hh_len); 343 skb_reserve(skb, LL_RESERVED_SPACE(rt->u.dst.dev));
346 344
347 skb->priority = sk->sk_priority; 345 skb->priority = sk->sk_priority;
348 skb->mark = sk->sk_mark; 346 skb->mark = sk->sk_mark;
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 26c936930e92..b54d9d37b636 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1842,9 +1842,16 @@ static void tcp_enter_frto_loss(struct sock *sk, int allowed_segments, int flag)
1842 TCP_SKB_CB(skb)->sacked &= ~TCPCB_SACKED_RETRANS; 1842 TCP_SKB_CB(skb)->sacked &= ~TCPCB_SACKED_RETRANS;
1843 } 1843 }
1844 1844
1845 /* Don't lost mark skbs that were fwd transmitted after RTO */ 1845 /* Marking forward transmissions that were made after RTO lost
1846 if (!(TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED) && 1846 * can cause unnecessary retransmissions in some scenarios,
1847 !after(TCP_SKB_CB(skb)->end_seq, tp->frto_highmark)) { 1847 * SACK blocks will mitigate that in some but not in all cases.
1848 * We used to not mark them but it was causing break-ups with
1849 * receivers that do only in-order receival.
1850 *
1851 * TODO: we could detect presence of such receiver and select
1852 * different behavior per flow.
1853 */
1854 if (!(TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED)) {
1848 TCP_SKB_CB(skb)->sacked |= TCPCB_LOST; 1855 TCP_SKB_CB(skb)->sacked |= TCPCB_LOST;
1849 tp->lost_out += tcp_skb_pcount(skb); 1856 tp->lost_out += tcp_skb_pcount(skb);
1850 } 1857 }
@@ -1860,7 +1867,7 @@ static void tcp_enter_frto_loss(struct sock *sk, int allowed_segments, int flag)
1860 tp->reordering = min_t(unsigned int, tp->reordering, 1867 tp->reordering = min_t(unsigned int, tp->reordering,
1861 sysctl_tcp_reordering); 1868 sysctl_tcp_reordering);
1862 tcp_set_ca_state(sk, TCP_CA_Loss); 1869 tcp_set_ca_state(sk, TCP_CA_Loss);
1863 tp->high_seq = tp->frto_highmark; 1870 tp->high_seq = tp->snd_nxt;
1864 TCP_ECN_queue_cwr(tp); 1871 TCP_ECN_queue_cwr(tp);
1865 1872
1866 tcp_clear_retrans_hints_partial(tp); 1873 tcp_clear_retrans_hints_partial(tp);
@@ -2482,7 +2489,7 @@ static void tcp_try_to_open(struct sock *sk, int flag)
2482 2489
2483 tcp_verify_left_out(tp); 2490 tcp_verify_left_out(tp);
2484 2491
2485 if (tp->retrans_out == 0) 2492 if (!tp->frto_counter && tp->retrans_out == 0)
2486 tp->retrans_stamp = 0; 2493 tp->retrans_stamp = 0;
2487 2494
2488 if (flag & FLAG_ECE) 2495 if (flag & FLAG_ECE)
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index 0af2e055f883..48cdce9c696c 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -780,7 +780,7 @@ slow_path:
780 * Allocate buffer. 780 * Allocate buffer.
781 */ 781 */
782 782
783 if ((frag = alloc_skb(len+hlen+sizeof(struct frag_hdr)+LL_RESERVED_SPACE(rt->u.dst.dev), GFP_ATOMIC)) == NULL) { 783 if ((frag = alloc_skb(len+hlen+sizeof(struct frag_hdr)+LL_ALLOCATED_SPACE(rt->u.dst.dev), GFP_ATOMIC)) == NULL) {
784 NETDEBUG(KERN_INFO "IPv6: frag: no memory for new fragment!\n"); 784 NETDEBUG(KERN_INFO "IPv6: frag: no memory for new fragment!\n");
785 IP6_INC_STATS(ip6_dst_idev(skb->dst), 785 IP6_INC_STATS(ip6_dst_idev(skb->dst),
786 IPSTATS_MIB_FRAGFAILS); 786 IPSTATS_MIB_FRAGFAILS);
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 54f91efdae58..fd632dd7f98d 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -1411,7 +1411,7 @@ static struct sk_buff *mld_newpack(struct net_device *dev, int size)
1411 IPV6_TLV_PADN, 0 }; 1411 IPV6_TLV_PADN, 0 };
1412 1412
1413 /* we assume size > sizeof(ra) here */ 1413 /* we assume size > sizeof(ra) here */
1414 skb = sock_alloc_send_skb(sk, size + LL_RESERVED_SPACE(dev), 1, &err); 1414 skb = sock_alloc_send_skb(sk, size + LL_ALLOCATED_SPACE(dev), 1, &err);
1415 1415
1416 if (!skb) 1416 if (!skb)
1417 return NULL; 1417 return NULL;
@@ -1790,7 +1790,7 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type)
1790 payload_len = len + sizeof(ra); 1790 payload_len = len + sizeof(ra);
1791 full_len = sizeof(struct ipv6hdr) + payload_len; 1791 full_len = sizeof(struct ipv6hdr) + payload_len;
1792 1792
1793 skb = sock_alloc_send_skb(sk, LL_RESERVED_SPACE(dev) + full_len, 1, &err); 1793 skb = sock_alloc_send_skb(sk, LL_ALLOCATED_SPACE(dev) + full_len, 1, &err);
1794 1794
1795 if (skb == NULL) { 1795 if (skb == NULL) {
1796 rcu_read_lock(); 1796 rcu_read_lock();
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 2c74885f8355..a55fc05b8125 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -479,7 +479,7 @@ static void __ndisc_send(struct net_device *dev,
479 479
480 skb = sock_alloc_send_skb(sk, 480 skb = sock_alloc_send_skb(sk,
481 (MAX_HEADER + sizeof(struct ipv6hdr) + 481 (MAX_HEADER + sizeof(struct ipv6hdr) +
482 len + LL_RESERVED_SPACE(dev)), 482 len + LL_ALLOCATED_SPACE(dev)),
483 1, &err); 483 1, &err);
484 if (!skb) { 484 if (!skb) {
485 ND_PRINTK0(KERN_ERR 485 ND_PRINTK0(KERN_ERR
@@ -1521,7 +1521,7 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
1521 1521
1522 buff = sock_alloc_send_skb(sk, 1522 buff = sock_alloc_send_skb(sk,
1523 (MAX_HEADER + sizeof(struct ipv6hdr) + 1523 (MAX_HEADER + sizeof(struct ipv6hdr) +
1524 len + LL_RESERVED_SPACE(dev)), 1524 len + LL_ALLOCATED_SPACE(dev)),
1525 1, &err); 1525 1, &err);
1526 if (buff == NULL) { 1526 if (buff == NULL) {
1527 ND_PRINTK0(KERN_ERR 1527 ND_PRINTK0(KERN_ERR
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index 396f0ea11090..232e0dc45bf5 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -609,7 +609,6 @@ static int rawv6_send_hdrinc(struct sock *sk, void *from, int length,
609 struct ipv6_pinfo *np = inet6_sk(sk); 609 struct ipv6_pinfo *np = inet6_sk(sk);
610 struct ipv6hdr *iph; 610 struct ipv6hdr *iph;
611 struct sk_buff *skb; 611 struct sk_buff *skb;
612 unsigned int hh_len;
613 int err; 612 int err;
614 613
615 if (length > rt->u.dst.dev->mtu) { 614 if (length > rt->u.dst.dev->mtu) {
@@ -619,13 +618,12 @@ static int rawv6_send_hdrinc(struct sock *sk, void *from, int length,
619 if (flags&MSG_PROBE) 618 if (flags&MSG_PROBE)
620 goto out; 619 goto out;
621 620
622 hh_len = LL_RESERVED_SPACE(rt->u.dst.dev); 621 skb = sock_alloc_send_skb(sk,
623 622 length + LL_ALLOCATED_SPACE(rt->u.dst.dev) + 15,
624 skb = sock_alloc_send_skb(sk, length+hh_len+15, 623 flags & MSG_DONTWAIT, &err);
625 flags&MSG_DONTWAIT, &err);
626 if (skb == NULL) 624 if (skb == NULL)
627 goto error; 625 goto error;
628 skb_reserve(skb, hh_len); 626 skb_reserve(skb, LL_RESERVED_SPACE(rt->u.dst.dev));
629 627
630 skb->priority = sk->sk_priority; 628 skb->priority = sk->sk_priority;
631 skb->mark = sk->sk_mark; 629 skb->mark = sk->sk_mark;
diff --git a/net/irda/discovery.c b/net/irda/discovery.c
index bfacef8b76f4..a6f99b5a1499 100644
--- a/net/irda/discovery.c
+++ b/net/irda/discovery.c
@@ -40,6 +40,8 @@
40 40
41#include <net/irda/discovery.h> 41#include <net/irda/discovery.h>
42 42
43#include <asm/unaligned.h>
44
43/* 45/*
44 * Function irlmp_add_discovery (cachelog, discovery) 46 * Function irlmp_add_discovery (cachelog, discovery)
45 * 47 *
@@ -87,7 +89,7 @@ void irlmp_add_discovery(hashbin_t *cachelog, discovery_t *new)
87 */ 89 */
88 hashbin_remove_this(cachelog, (irda_queue_t *) node); 90 hashbin_remove_this(cachelog, (irda_queue_t *) node);
89 /* Check if hints bits are unchanged */ 91 /* Check if hints bits are unchanged */
90 if(u16ho(node->data.hints) == u16ho(new->data.hints)) 92 if (get_unaligned((__u16 *)node->data.hints) == get_unaligned((__u16 *)new->data.hints))
91 /* Set time of first discovery for this node */ 93 /* Set time of first discovery for this node */
92 new->firststamp = node->firststamp; 94 new->firststamp = node->firststamp;
93 kfree(node); 95 kfree(node);
@@ -281,9 +283,9 @@ struct irda_device_info *irlmp_copy_discoveries(hashbin_t *log, int *pn,
281 /* Mask out the ones we don't want : 283 /* Mask out the ones we don't want :
282 * We want to match the discovery mask, and to get only 284 * We want to match the discovery mask, and to get only
283 * the most recent one (unless we want old ones) */ 285 * the most recent one (unless we want old ones) */
284 if ((u16ho(discovery->data.hints) & mask) && 286 if ((get_unaligned((__u16 *)discovery->data.hints) & mask) &&
285 ((old_entries) || 287 ((old_entries) ||
286 ((jiffies - discovery->firststamp) < j_timeout)) ) { 288 ((jiffies - discovery->firststamp) < j_timeout))) {
287 /* Create buffer as needed. 289 /* Create buffer as needed.
288 * As this function get called a lot and most time 290 * As this function get called a lot and most time
289 * we don't have anything to put in the log (we are 291 * we don't have anything to put in the log (we are
diff --git a/net/irda/irlmp.c b/net/irda/irlmp.c
index 1f81f8e7c61d..7bf5b913828b 100644
--- a/net/irda/irlmp.c
+++ b/net/irda/irlmp.c
@@ -1062,7 +1062,8 @@ void irlmp_discovery_expiry(discinfo_t *expiries, int number)
1062 for(i = 0; i < number; i++) { 1062 for(i = 0; i < number; i++) {
1063 /* Check if we should notify client */ 1063 /* Check if we should notify client */
1064 if ((client->expir_callback) && 1064 if ((client->expir_callback) &&
1065 (client->hint_mask.word & u16ho(expiries[i].hints) 1065 (client->hint_mask.word &
1066 get_unaligned((__u16 *)expiries[i].hints)
1066 & 0x7f7f) ) 1067 & 0x7f7f) )
1067 client->expir_callback(&(expiries[i]), 1068 client->expir_callback(&(expiries[i]),
1068 EXPIRY_TIMEOUT, 1069 EXPIRY_TIMEOUT,
@@ -1086,7 +1087,7 @@ discovery_t *irlmp_get_discovery_response(void)
1086 1087
1087 IRDA_ASSERT(irlmp != NULL, return NULL;); 1088 IRDA_ASSERT(irlmp != NULL, return NULL;);
1088 1089
1089 u16ho(irlmp->discovery_rsp.data.hints) = irlmp->hints.word; 1090 put_unaligned(irlmp->hints.word, (__u16 *)irlmp->discovery_rsp.data.hints);
1090 1091
1091 /* 1092 /*
1092 * Set character set for device name (we use ASCII), and 1093 * Set character set for device name (we use ASCII), and
diff --git a/net/irda/irnet/irnet_irda.c b/net/irda/irnet/irnet_irda.c
index 75497e55927d..a3ec0026cdb2 100644
--- a/net/irda/irnet/irnet_irda.c
+++ b/net/irda/irnet/irnet_irda.c
@@ -1673,7 +1673,7 @@ irnet_discovery_indication(discinfo_t * discovery,
1673 /* Notify the control channel */ 1673 /* Notify the control channel */
1674 irnet_post_event(NULL, IRNET_DISCOVER, 1674 irnet_post_event(NULL, IRNET_DISCOVER,
1675 discovery->saddr, discovery->daddr, discovery->info, 1675 discovery->saddr, discovery->daddr, discovery->info,
1676 u16ho(discovery->hints)); 1676 get_unaligned((__u16 *)discovery->hints));
1677 1677
1678 DEXIT(IRDA_OCB_TRACE, "\n"); 1678 DEXIT(IRDA_OCB_TRACE, "\n");
1679} 1679}
@@ -1704,7 +1704,7 @@ irnet_expiry_indication(discinfo_t * expiry,
1704 /* Notify the control channel */ 1704 /* Notify the control channel */
1705 irnet_post_event(NULL, IRNET_EXPIRE, 1705 irnet_post_event(NULL, IRNET_EXPIRE,
1706 expiry->saddr, expiry->daddr, expiry->info, 1706 expiry->saddr, expiry->daddr, expiry->info,
1707 u16ho(expiry->hints)); 1707 get_unaligned((__u16 *)expiry->hints));
1708 1708
1709 DEXIT(IRDA_OCB_TRACE, "\n"); 1709 DEXIT(IRDA_OCB_TRACE, "\n");
1710} 1710}
diff --git a/net/mac80211/debugfs_key.c b/net/mac80211/debugfs_key.c
index 879e7210458a..19efc3a6a932 100644
--- a/net/mac80211/debugfs_key.c
+++ b/net/mac80211/debugfs_key.c
@@ -255,14 +255,23 @@ void ieee80211_debugfs_key_remove(struct ieee80211_key *key)
255void ieee80211_debugfs_key_add_default(struct ieee80211_sub_if_data *sdata) 255void ieee80211_debugfs_key_add_default(struct ieee80211_sub_if_data *sdata)
256{ 256{
257 char buf[50]; 257 char buf[50];
258 struct ieee80211_key *key;
258 259
259 if (!sdata->debugfsdir) 260 if (!sdata->debugfsdir)
260 return; 261 return;
261 262
262 sprintf(buf, "../keys/%d", sdata->default_key->debugfs.cnt); 263 /* this is running under the key lock */
263 sdata->debugfs.default_key = 264
264 debugfs_create_symlink("default_key", sdata->debugfsdir, buf); 265 key = sdata->default_key;
266 if (key) {
267 sprintf(buf, "../keys/%d", key->debugfs.cnt);
268 sdata->debugfs.default_key =
269 debugfs_create_symlink("default_key",
270 sdata->debugfsdir, buf);
271 } else
272 ieee80211_debugfs_key_remove_default(sdata);
265} 273}
274
266void ieee80211_debugfs_key_remove_default(struct ieee80211_sub_if_data *sdata) 275void ieee80211_debugfs_key_remove_default(struct ieee80211_sub_if_data *sdata)
267{ 276{
268 if (!sdata) 277 if (!sdata)
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 80954a512185..06e88a5a036d 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -54,6 +54,15 @@ int ieee80211_if_add(struct net_device *dev, const char *name,
54 if (!ndev) 54 if (!ndev)
55 return -ENOMEM; 55 return -ENOMEM;
56 56
57 ndev->needed_headroom = local->tx_headroom +
58 4*6 /* four MAC addresses */
59 + 2 + 2 + 2 + 2 /* ctl, dur, seq, qos */
60 + 6 /* mesh */
61 + 8 /* rfc1042/bridge tunnel */
62 - ETH_HLEN /* ethernet hard_header_len */
63 + IEEE80211_ENCRYPT_HEADROOM;
64 ndev->needed_tailroom = IEEE80211_ENCRYPT_TAILROOM;
65
57 ret = dev_alloc_name(ndev, ndev->name); 66 ret = dev_alloc_name(ndev, ndev->name);
58 if (ret < 0) 67 if (ret < 0)
59 goto fail; 68 goto fail;
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index f76bc26ae4d2..697ef67f96b6 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -397,7 +397,7 @@ int ieee80211_new_mesh_header(struct ieee80211s_hdr *meshhdr,
397 put_unaligned(cpu_to_le32(sdata->u.sta.mesh_seqnum), &meshhdr->seqnum); 397 put_unaligned(cpu_to_le32(sdata->u.sta.mesh_seqnum), &meshhdr->seqnum);
398 sdata->u.sta.mesh_seqnum++; 398 sdata->u.sta.mesh_seqnum++;
399 399
400 return 5; 400 return 6;
401} 401}
402 402
403void ieee80211_mesh_init_sdata(struct ieee80211_sub_if_data *sdata) 403void ieee80211_mesh_init_sdata(struct ieee80211_sub_if_data *sdata)
diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
index 3df809222d1c..af0cd1e3e213 100644
--- a/net/mac80211/mesh_hwmp.c
+++ b/net/mac80211/mesh_hwmp.c
@@ -120,7 +120,7 @@ static int mesh_path_sel_frame_tx(enum mpath_frame_type action, u8 flags,
120 *pos++ = WLAN_EID_PREP; 120 *pos++ = WLAN_EID_PREP;
121 break; 121 break;
122 default: 122 default:
123 kfree(skb); 123 kfree_skb(skb);
124 return -ENOTSUPP; 124 return -ENOTSUPP;
125 break; 125 break;
126 } 126 }
diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c
index 5845dc21ce85..99c2d360888e 100644
--- a/net/mac80211/mesh_pathtbl.c
+++ b/net/mac80211/mesh_pathtbl.c
@@ -158,19 +158,25 @@ int mesh_path_add(u8 *dst, struct net_device *dev)
158 if (atomic_add_unless(&sdata->u.sta.mpaths, 1, MESH_MAX_MPATHS) == 0) 158 if (atomic_add_unless(&sdata->u.sta.mpaths, 1, MESH_MAX_MPATHS) == 0)
159 return -ENOSPC; 159 return -ENOSPC;
160 160
161 read_lock(&pathtbl_resize_lock);
162
163 new_mpath = kzalloc(sizeof(struct mesh_path), GFP_KERNEL); 161 new_mpath = kzalloc(sizeof(struct mesh_path), GFP_KERNEL);
164 if (!new_mpath) { 162 if (!new_mpath) {
165 atomic_dec(&sdata->u.sta.mpaths); 163 atomic_dec(&sdata->u.sta.mpaths);
166 err = -ENOMEM; 164 err = -ENOMEM;
167 goto endadd2; 165 goto endadd2;
168 } 166 }
167 new_node = kmalloc(sizeof(struct mpath_node), GFP_KERNEL);
168 if (!new_node) {
169 kfree(new_mpath);
170 atomic_dec(&sdata->u.sta.mpaths);
171 err = -ENOMEM;
172 goto endadd2;
173 }
174
175 read_lock(&pathtbl_resize_lock);
169 memcpy(new_mpath->dst, dst, ETH_ALEN); 176 memcpy(new_mpath->dst, dst, ETH_ALEN);
170 new_mpath->dev = dev; 177 new_mpath->dev = dev;
171 new_mpath->flags = 0; 178 new_mpath->flags = 0;
172 skb_queue_head_init(&new_mpath->frame_queue); 179 skb_queue_head_init(&new_mpath->frame_queue);
173 new_node = kmalloc(sizeof(struct mpath_node), GFP_KERNEL);
174 new_node->mpath = new_mpath; 180 new_node->mpath = new_mpath;
175 new_mpath->timer.data = (unsigned long) new_mpath; 181 new_mpath->timer.data = (unsigned long) new_mpath;
176 new_mpath->timer.function = mesh_path_timer; 182 new_mpath->timer.function = mesh_path_timer;
@@ -202,7 +208,6 @@ int mesh_path_add(u8 *dst, struct net_device *dev)
202 208
203endadd: 209endadd:
204 spin_unlock(&mesh_paths->hashwlock[hash_idx]); 210 spin_unlock(&mesh_paths->hashwlock[hash_idx]);
205endadd2:
206 read_unlock(&pathtbl_resize_lock); 211 read_unlock(&pathtbl_resize_lock);
207 if (!err && grow) { 212 if (!err && grow) {
208 struct mesh_table *oldtbl, *newtbl; 213 struct mesh_table *oldtbl, *newtbl;
@@ -215,10 +220,12 @@ endadd2:
215 return -ENOMEM; 220 return -ENOMEM;
216 } 221 }
217 rcu_assign_pointer(mesh_paths, newtbl); 222 rcu_assign_pointer(mesh_paths, newtbl);
223 write_unlock(&pathtbl_resize_lock);
224
218 synchronize_rcu(); 225 synchronize_rcu();
219 mesh_table_free(oldtbl, false); 226 mesh_table_free(oldtbl, false);
220 write_unlock(&pathtbl_resize_lock);
221 } 227 }
228endadd2:
222 return err; 229 return err;
223} 230}
224 231
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index a5e5c31c23ab..4adba09e80ca 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -665,6 +665,26 @@ static void ieee80211_authenticate(struct net_device *dev,
665 mod_timer(&ifsta->timer, jiffies + IEEE80211_AUTH_TIMEOUT); 665 mod_timer(&ifsta->timer, jiffies + IEEE80211_AUTH_TIMEOUT);
666} 666}
667 667
668static int ieee80211_compatible_rates(struct ieee80211_sta_bss *bss,
669 struct ieee80211_supported_band *sband,
670 u64 *rates)
671{
672 int i, j, count;
673 *rates = 0;
674 count = 0;
675 for (i = 0; i < bss->supp_rates_len; i++) {
676 int rate = (bss->supp_rates[i] & 0x7F) * 5;
677
678 for (j = 0; j < sband->n_bitrates; j++)
679 if (sband->bitrates[j].bitrate == rate) {
680 *rates |= BIT(j);
681 count++;
682 break;
683 }
684 }
685
686 return count;
687}
668 688
669static void ieee80211_send_assoc(struct net_device *dev, 689static void ieee80211_send_assoc(struct net_device *dev,
670 struct ieee80211_if_sta *ifsta) 690 struct ieee80211_if_sta *ifsta)
@@ -673,11 +693,12 @@ static void ieee80211_send_assoc(struct net_device *dev,
673 struct sk_buff *skb; 693 struct sk_buff *skb;
674 struct ieee80211_mgmt *mgmt; 694 struct ieee80211_mgmt *mgmt;
675 u8 *pos, *ies; 695 u8 *pos, *ies;
676 int i, len; 696 int i, len, count, rates_len, supp_rates_len;
677 u16 capab; 697 u16 capab;
678 struct ieee80211_sta_bss *bss; 698 struct ieee80211_sta_bss *bss;
679 int wmm = 0; 699 int wmm = 0;
680 struct ieee80211_supported_band *sband; 700 struct ieee80211_supported_band *sband;
701 u64 rates = 0;
681 702
682 skb = dev_alloc_skb(local->hw.extra_tx_headroom + 703 skb = dev_alloc_skb(local->hw.extra_tx_headroom +
683 sizeof(*mgmt) + 200 + ifsta->extra_ie_len + 704 sizeof(*mgmt) + 200 + ifsta->extra_ie_len +
@@ -740,24 +761,39 @@ static void ieee80211_send_assoc(struct net_device *dev,
740 *pos++ = ifsta->ssid_len; 761 *pos++ = ifsta->ssid_len;
741 memcpy(pos, ifsta->ssid, ifsta->ssid_len); 762 memcpy(pos, ifsta->ssid, ifsta->ssid_len);
742 763
764 /* all supported rates should be added here but some APs
765 * (e.g. D-Link DAP 1353 in b-only mode) don't like that
766 * Therefore only add rates the AP supports */
767 rates_len = ieee80211_compatible_rates(bss, sband, &rates);
768 supp_rates_len = rates_len;
769 if (supp_rates_len > 8)
770 supp_rates_len = 8;
771
743 len = sband->n_bitrates; 772 len = sband->n_bitrates;
744 if (len > 8) 773 pos = skb_put(skb, supp_rates_len + 2);
745 len = 8;
746 pos = skb_put(skb, len + 2);
747 *pos++ = WLAN_EID_SUPP_RATES; 774 *pos++ = WLAN_EID_SUPP_RATES;
748 *pos++ = len; 775 *pos++ = supp_rates_len;
749 for (i = 0; i < len; i++) {
750 int rate = sband->bitrates[i].bitrate;
751 *pos++ = (u8) (rate / 5);
752 }
753 776
754 if (sband->n_bitrates > len) { 777 count = 0;
755 pos = skb_put(skb, sband->n_bitrates - len + 2); 778 for (i = 0; i < sband->n_bitrates; i++) {
756 *pos++ = WLAN_EID_EXT_SUPP_RATES; 779 if (BIT(i) & rates) {
757 *pos++ = sband->n_bitrates - len;
758 for (i = len; i < sband->n_bitrates; i++) {
759 int rate = sband->bitrates[i].bitrate; 780 int rate = sband->bitrates[i].bitrate;
760 *pos++ = (u8) (rate / 5); 781 *pos++ = (u8) (rate / 5);
782 if (++count == 8)
783 break;
784 }
785 }
786
787 if (count == 8) {
788 pos = skb_put(skb, rates_len - count + 2);
789 *pos++ = WLAN_EID_EXT_SUPP_RATES;
790 *pos++ = rates_len - count;
791
792 for (i++; i < sband->n_bitrates; i++) {
793 if (BIT(i) & rates) {
794 int rate = sband->bitrates[i].bitrate;
795 *pos++ = (u8) (rate / 5);
796 }
761 } 797 }
762 } 798 }
763 799
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 02f436a86061..1958bfb361c6 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -1305,11 +1305,11 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx)
1305 if (is_multicast_ether_addr(skb->data)) { 1305 if (is_multicast_ether_addr(skb->data)) {
1306 if (*mesh_ttl > 0) { 1306 if (*mesh_ttl > 0) {
1307 xmit_skb = skb_copy(skb, GFP_ATOMIC); 1307 xmit_skb = skb_copy(skb, GFP_ATOMIC);
1308 if (!xmit_skb && net_ratelimit()) 1308 if (xmit_skb)
1309 xmit_skb->pkt_type = PACKET_OTHERHOST;
1310 else if (net_ratelimit())
1309 printk(KERN_DEBUG "%s: failed to clone " 1311 printk(KERN_DEBUG "%s: failed to clone "
1310 "multicast frame\n", dev->name); 1312 "multicast frame\n", dev->name);
1311 else
1312 xmit_skb->pkt_type = PACKET_OTHERHOST;
1313 } else 1313 } else
1314 IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.sta, 1314 IEEE80211_IFSTA_MESH_CTR_INC(&sdata->u.sta,
1315 dropped_frames_ttl); 1315 dropped_frames_ttl);
@@ -1395,7 +1395,7 @@ ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx)
1395 padding = ((4 - subframe_len) & 0x3); 1395 padding = ((4 - subframe_len) & 0x3);
1396 /* the last MSDU has no padding */ 1396 /* the last MSDU has no padding */
1397 if (subframe_len > remaining) { 1397 if (subframe_len > remaining) {
1398 printk(KERN_DEBUG "%s: wrong buffer size", dev->name); 1398 printk(KERN_DEBUG "%s: wrong buffer size\n", dev->name);
1399 return RX_DROP_UNUSABLE; 1399 return RX_DROP_UNUSABLE;
1400 } 1400 }
1401 1401
@@ -1418,7 +1418,7 @@ ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx)
1418 eth = (struct ethhdr *) skb_pull(skb, ntohs(len) + 1418 eth = (struct ethhdr *) skb_pull(skb, ntohs(len) +
1419 padding); 1419 padding);
1420 if (!eth) { 1420 if (!eth) {
1421 printk(KERN_DEBUG "%s: wrong buffer size ", 1421 printk(KERN_DEBUG "%s: wrong buffer size\n",
1422 dev->name); 1422 dev->name);
1423 dev_kfree_skb(frame); 1423 dev_kfree_skb(frame);
1424 return RX_DROP_UNUSABLE; 1424 return RX_DROP_UNUSABLE;
@@ -1952,7 +1952,7 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw,
1952 if (!skb_new) { 1952 if (!skb_new) {
1953 if (net_ratelimit()) 1953 if (net_ratelimit())
1954 printk(KERN_DEBUG "%s: failed to copy " 1954 printk(KERN_DEBUG "%s: failed to copy "
1955 "multicast frame for %s", 1955 "multicast frame for %s\n",
1956 wiphy_name(local->hw.wiphy), 1956 wiphy_name(local->hw.wiphy),
1957 prev->dev->name); 1957 prev->dev->name);
1958 continue; 1958 continue;
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index f35eaea98e73..1d7dd54aacef 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1562,13 +1562,13 @@ int ieee80211_subif_start_xmit(struct sk_buff *skb,
1562 * be cloned. This could happen, e.g., with Linux bridge code passing 1562 * be cloned. This could happen, e.g., with Linux bridge code passing
1563 * us broadcast frames. */ 1563 * us broadcast frames. */
1564 1564
1565 if (head_need > 0 || skb_cloned(skb)) { 1565 if (head_need > 0 || skb_header_cloned(skb)) {
1566#if 0 1566#if 0
1567 printk(KERN_DEBUG "%s: need to reallocate buffer for %d bytes " 1567 printk(KERN_DEBUG "%s: need to reallocate buffer for %d bytes "
1568 "of headroom\n", dev->name, head_need); 1568 "of headroom\n", dev->name, head_need);
1569#endif 1569#endif
1570 1570
1571 if (skb_cloned(skb)) 1571 if (skb_header_cloned(skb))
1572 I802_DEBUG_INC(local->tx_expand_skb_head_cloned); 1572 I802_DEBUG_INC(local->tx_expand_skb_head_cloned);
1573 else 1573 else
1574 I802_DEBUG_INC(local->tx_expand_skb_head); 1574 I802_DEBUG_INC(local->tx_expand_skb_head);
@@ -1898,6 +1898,7 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
1898 control->flags |= IEEE80211_TXCTL_SHORT_PREAMBLE; 1898 control->flags |= IEEE80211_TXCTL_SHORT_PREAMBLE;
1899 control->antenna_sel_tx = local->hw.conf.antenna_sel_tx; 1899 control->antenna_sel_tx = local->hw.conf.antenna_sel_tx;
1900 control->flags |= IEEE80211_TXCTL_NO_ACK; 1900 control->flags |= IEEE80211_TXCTL_NO_ACK;
1901 control->flags |= IEEE80211_TXCTL_DO_NOT_ENCRYPT;
1901 control->retry_limit = 1; 1902 control->retry_limit = 1;
1902 control->flags |= IEEE80211_TXCTL_CLEAR_PS_FILT; 1903 control->flags |= IEEE80211_TXCTL_CLEAR_PS_FILT;
1903 } 1904 }
diff --git a/net/mac80211/util.c b/net/mac80211/util.c
index cc9f715c7bfc..24a465c4df09 100644
--- a/net/mac80211/util.c
+++ b/net/mac80211/util.c
@@ -153,15 +153,15 @@ int ieee80211_get_mesh_hdrlen(struct ieee80211s_hdr *meshhdr)
153 /* 7.1.3.5a.2 */ 153 /* 7.1.3.5a.2 */
154 switch (ae) { 154 switch (ae) {
155 case 0: 155 case 0:
156 return 5; 156 return 6;
157 case 1: 157 case 1:
158 return 11; 158 return 12;
159 case 2: 159 case 2:
160 return 17; 160 return 18;
161 case 3: 161 case 3:
162 return 23; 162 return 24;
163 default: 163 default:
164 return 5; 164 return 6;
165 } 165 }
166} 166}
167 167
diff --git a/net/mac80211/wme.c b/net/mac80211/wme.c
index 64faa3dc488f..dc1598b86004 100644
--- a/net/mac80211/wme.c
+++ b/net/mac80211/wme.c
@@ -394,7 +394,8 @@ static int wme_qdiscop_init(struct Qdisc *qd, struct nlattr *opt)
394 qd->handle); 394 qd->handle);
395 if (!q->queues[i]) { 395 if (!q->queues[i]) {
396 q->queues[i] = &noop_qdisc; 396 q->queues[i] = &noop_qdisc;
397 printk(KERN_ERR "%s child qdisc %i creation failed", dev->name, i); 397 printk(KERN_ERR "%s child qdisc %i creation failed\n",
398 dev->name, i);
398 } 399 }
399 } 400 }
400 401
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
index 16774ecd1c4e..0edefcfc5949 100644
--- a/net/netfilter/nf_conntrack_netlink.c
+++ b/net/netfilter/nf_conntrack_netlink.c
@@ -472,6 +472,9 @@ static int ctnetlink_conntrack_event(struct notifier_block *this,
472 goto nla_put_failure; 472 goto nla_put_failure;
473 nla_nest_end(skb, nest_parms); 473 nla_nest_end(skb, nest_parms);
474 474
475 if (ctnetlink_dump_id(skb, ct) < 0)
476 goto nla_put_failure;
477
475 if (events & IPCT_DESTROY) { 478 if (events & IPCT_DESTROY) {
476 if (ctnetlink_dump_counters(skb, ct, IP_CT_DIR_ORIGINAL) < 0 || 479 if (ctnetlink_dump_counters(skb, ct, IP_CT_DIR_ORIGINAL) < 0 ||
477 ctnetlink_dump_counters(skb, ct, IP_CT_DIR_REPLY) < 0) 480 ctnetlink_dump_counters(skb, ct, IP_CT_DIR_REPLY) < 0)
diff --git a/net/netfilter/xt_iprange.c b/net/netfilter/xt_iprange.c
index 500528d60cd7..c63e9333c755 100644
--- a/net/netfilter/xt_iprange.c
+++ b/net/netfilter/xt_iprange.c
@@ -179,3 +179,5 @@ module_exit(iprange_mt_exit);
179MODULE_LICENSE("GPL"); 179MODULE_LICENSE("GPL");
180MODULE_AUTHOR("Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>, Jan Engelhardt <jengelh@computergmbh.de>"); 180MODULE_AUTHOR("Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>, Jan Engelhardt <jengelh@computergmbh.de>");
181MODULE_DESCRIPTION("Xtables: arbitrary IPv4 range matching"); 181MODULE_DESCRIPTION("Xtables: arbitrary IPv4 range matching");
182MODULE_ALIAS("ipt_iprange");
183MODULE_ALIAS("ip6t_iprange");
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 25070240d4ae..2cee87da4441 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -743,7 +743,7 @@ static int packet_sendmsg(struct kiocb *iocb, struct socket *sock,
743 if (len > dev->mtu+reserve) 743 if (len > dev->mtu+reserve)
744 goto out_unlock; 744 goto out_unlock;
745 745
746 skb = sock_alloc_send_skb(sk, len + LL_RESERVED_SPACE(dev), 746 skb = sock_alloc_send_skb(sk, len + LL_ALLOCATED_SPACE(dev),
747 msg->msg_flags & MSG_DONTWAIT, &err); 747 msg->msg_flags & MSG_DONTWAIT, &err);
748 if (skb==NULL) 748 if (skb==NULL)
749 goto out_unlock; 749 goto out_unlock;
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 81b606424e12..bbc7107c86cf 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -2418,7 +2418,8 @@ static int sctp_process_param(struct sctp_association *asoc,
2418 break; 2418 break;
2419 2419
2420 case SCTP_PARAM_IPV6_ADDRESS: 2420 case SCTP_PARAM_IPV6_ADDRESS:
2421 asoc->peer.ipv6_address = 1; 2421 if (PF_INET6 == asoc->base.sk->sk_family)
2422 asoc->peer.ipv6_address = 1;
2422 break; 2423 break;
2423 2424
2424 case SCTP_PARAM_HOST_NAME_ADDRESS: 2425 case SCTP_PARAM_HOST_NAME_ADDRESS:
@@ -2829,6 +2830,19 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
2829 addr_param = (union sctp_addr_param *) 2830 addr_param = (union sctp_addr_param *)
2830 ((void *)asconf_param + sizeof(sctp_addip_param_t)); 2831 ((void *)asconf_param + sizeof(sctp_addip_param_t));
2831 2832
2833 switch (addr_param->v4.param_hdr.type) {
2834 case SCTP_PARAM_IPV6_ADDRESS:
2835 if (!asoc->peer.ipv6_address)
2836 return SCTP_ERROR_INV_PARAM;
2837 break;
2838 case SCTP_PARAM_IPV4_ADDRESS:
2839 if (!asoc->peer.ipv4_address)
2840 return SCTP_ERROR_INV_PARAM;
2841 break;
2842 default:
2843 return SCTP_ERROR_INV_PARAM;
2844 }
2845
2832 af = sctp_get_af_specific(param_type2af(addr_param->v4.param_hdr.type)); 2846 af = sctp_get_af_specific(param_type2af(addr_param->v4.param_hdr.type));
2833 if (unlikely(!af)) 2847 if (unlikely(!af))
2834 return SCTP_ERROR_INV_PARAM; 2848 return SCTP_ERROR_INV_PARAM;
diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
index 09cd9c0c2d80..3f964db908a7 100644
--- a/net/xfrm/xfrm_output.c
+++ b/net/xfrm/xfrm_output.c
@@ -25,11 +25,11 @@ static int xfrm_state_check_space(struct xfrm_state *x, struct sk_buff *skb)
25 struct dst_entry *dst = skb->dst; 25 struct dst_entry *dst = skb->dst;
26 int nhead = dst->header_len + LL_RESERVED_SPACE(dst->dev) 26 int nhead = dst->header_len + LL_RESERVED_SPACE(dst->dev)
27 - skb_headroom(skb); 27 - skb_headroom(skb);
28 int ntail = dst->dev->needed_tailroom - skb_tailroom(skb);
28 29
29 if (nhead > 0) 30 if (nhead > 0 || ntail > 0)
30 return pskb_expand_head(skb, nhead, 0, GFP_ATOMIC); 31 return pskb_expand_head(skb, nhead, ntail, GFP_ATOMIC);
31 32
32 /* Check tail too... */
33 return 0; 33 return 0;
34} 34}
35 35