diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-30 13:53:20 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-01-30 13:53:20 -0500 |
commit | a14a8d93169a8f2b0b000891571659ddbfa3a169 (patch) | |
tree | 36efa74c6f8c635079a8c3e057d25622282f4578 | |
parent | b527a2331b873b8bf0549a45fc1ff635dd230d15 (diff) | |
parent | 6f01fd6e6f6809061b56e78f1e8d143099716d70 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
1) Setting link attributes can modify the size of the attributes that
would be reported on a subsequent getlink netlink operation,
therefore min_ifinfo_dump_size needs to be adjusted. From Stefan
Gula.
2) Resegmentation of TSO frames while trimming can violate invariants
expected by callers, namely that the number of segments can only stay
the same or decrease, never increase. If MSS changes, however, we
can trim data but then end up with more segments. Fix this by only
segmenting to the MSS already recorded in the SKB. That's the
simplest fix for now and if we want to get more fancy in the future
that's a more involved change.
This probably explains some retransmit counter inaccuracies.
From Neal Cardwell.
3) Fix too-many-wakeups in POLL with AF_UNIX sockets, from Eric Dumazet.
4) Fix CAIF crashes wrt. namespace handling. From Eric Dumazet and
Eric W. Biederman.
5) TCP port selection fixes from Flavio Leitner.
6) More socket memory cgroup build fixes in certain randonfig
situations. From Glauber Costa.
7) Fix TCP memory sysctl regression reported by Ingo Molnar, also from
Glauber Costa.
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
af_unix: fix EPOLLET regression for stream sockets
tcp: fix tcp_trim_head() to adjust segment count with skb MSS
net/tcp: Fix tcp memory limits initialization when !CONFIG_SYSCTL
net caif: Register properly as a pernet subsystem.
netns: Fail conspicously if someone uses net_generic at an inappropriate time.
net: explicitly add jump_label.h header to sock.h
net: RTNETLINK adjusting values of min_ifinfo_dump_size
ipv6: Fix ip_gre lockless xmits.
xen-netfront: correct MAX_TX_TARGET calculation.
netns: fix net_alloc_generic()
tcp: bind() optimize port allocation
tcp: bind() fix autoselection to share ports
l2tp: l2tp_ip - fix possible oops on packet receive
iwlwifi: fix PCI-E transport "inta" race
mac80211: set bss_conf.idle when vif is connected
mac80211: update oper_channel on ibss join
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c | 4 | ||||
-rw-r--r-- | drivers/net/xen-netfront.c | 2 | ||||
-rw-r--r-- | include/net/netns/generic.h | 1 | ||||
-rw-r--r-- | include/net/sock.h | 1 | ||||
-rw-r--r-- | include/net/tcp.h | 2 | ||||
-rw-r--r-- | net/caif/caif_dev.c | 22 | ||||
-rw-r--r-- | net/caif/cfcnfg.c | 1 | ||||
-rw-r--r-- | net/core/net_namespace.c | 31 | ||||
-rw-r--r-- | net/core/rtnetlink.c | 3 | ||||
-rw-r--r-- | net/ipv4/inet_connection_sock.c | 7 | ||||
-rw-r--r-- | net/ipv4/ip_gre.c | 4 | ||||
-rw-r--r-- | net/ipv4/sysctl_net_ipv4.c | 1 | ||||
-rw-r--r-- | net/ipv4/tcp.c | 16 | ||||
-rw-r--r-- | net/ipv4/tcp_output.c | 6 | ||||
-rw-r--r-- | net/l2tp/l2tp_ip.c | 5 | ||||
-rw-r--r-- | net/mac80211/ibss.c | 1 | ||||
-rw-r--r-- | net/mac80211/iface.c | 1 | ||||
-rw-r--r-- | net/unix/af_unix.c | 19 |
18 files changed, 59 insertions, 68 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c index 752493f00406..65d1f05007be 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c | |||
@@ -972,11 +972,11 @@ void iwl_irq_tasklet(struct iwl_trans *trans) | |||
972 | } | 972 | } |
973 | #endif | 973 | #endif |
974 | 974 | ||
975 | spin_unlock_irqrestore(&trans->shrd->lock, flags); | ||
976 | |||
977 | /* saved interrupt in inta variable now we can reset trans_pcie->inta */ | 975 | /* saved interrupt in inta variable now we can reset trans_pcie->inta */ |
978 | trans_pcie->inta = 0; | 976 | trans_pcie->inta = 0; |
979 | 977 | ||
978 | spin_unlock_irqrestore(&trans->shrd->lock, flags); | ||
979 | |||
980 | /* Now service all interrupt bits discovered above. */ | 980 | /* Now service all interrupt bits discovered above. */ |
981 | if (inta & CSR_INT_BIT_HW_ERR) { | 981 | if (inta & CSR_INT_BIT_HW_ERR) { |
982 | IWL_ERR(trans, "Hardware error detected. Restarting.\n"); | 982 | IWL_ERR(trans, "Hardware error detected. Restarting.\n"); |
diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c index fa679057630f..698b905058dd 100644 --- a/drivers/net/xen-netfront.c +++ b/drivers/net/xen-netfront.c | |||
@@ -68,7 +68,7 @@ struct netfront_cb { | |||
68 | 68 | ||
69 | #define NET_TX_RING_SIZE __CONST_RING_SIZE(xen_netif_tx, PAGE_SIZE) | 69 | #define NET_TX_RING_SIZE __CONST_RING_SIZE(xen_netif_tx, PAGE_SIZE) |
70 | #define NET_RX_RING_SIZE __CONST_RING_SIZE(xen_netif_rx, PAGE_SIZE) | 70 | #define NET_RX_RING_SIZE __CONST_RING_SIZE(xen_netif_rx, PAGE_SIZE) |
71 | #define TX_MAX_TARGET min_t(int, NET_RX_RING_SIZE, 256) | 71 | #define TX_MAX_TARGET min_t(int, NET_TX_RING_SIZE, 256) |
72 | 72 | ||
73 | struct netfront_stats { | 73 | struct netfront_stats { |
74 | u64 rx_packets; | 74 | u64 rx_packets; |
diff --git a/include/net/netns/generic.h b/include/net/netns/generic.h index 3419bf5cd154..d55f43443335 100644 --- a/include/net/netns/generic.h +++ b/include/net/netns/generic.h | |||
@@ -41,6 +41,7 @@ static inline void *net_generic(const struct net *net, int id) | |||
41 | ptr = ng->ptr[id - 1]; | 41 | ptr = ng->ptr[id - 1]; |
42 | rcu_read_unlock(); | 42 | rcu_read_unlock(); |
43 | 43 | ||
44 | BUG_ON(!ptr); | ||
44 | return ptr; | 45 | return ptr; |
45 | } | 46 | } |
46 | #endif | 47 | #endif |
diff --git a/include/net/sock.h b/include/net/sock.h index 4c69ac165e6b..91c1c8baf020 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -55,6 +55,7 @@ | |||
55 | #include <linux/uaccess.h> | 55 | #include <linux/uaccess.h> |
56 | #include <linux/memcontrol.h> | 56 | #include <linux/memcontrol.h> |
57 | #include <linux/res_counter.h> | 57 | #include <linux/res_counter.h> |
58 | #include <linux/jump_label.h> | ||
58 | 59 | ||
59 | #include <linux/filter.h> | 60 | #include <linux/filter.h> |
60 | #include <linux/rculist_nulls.h> | 61 | #include <linux/rculist_nulls.h> |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 0118ea999f67..d49db0113a06 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -311,6 +311,8 @@ extern struct proto tcp_prot; | |||
311 | #define TCP_ADD_STATS_USER(net, field, val) SNMP_ADD_STATS_USER((net)->mib.tcp_statistics, field, val) | 311 | #define TCP_ADD_STATS_USER(net, field, val) SNMP_ADD_STATS_USER((net)->mib.tcp_statistics, field, val) |
312 | #define TCP_ADD_STATS(net, field, val) SNMP_ADD_STATS((net)->mib.tcp_statistics, field, val) | 312 | #define TCP_ADD_STATS(net, field, val) SNMP_ADD_STATS((net)->mib.tcp_statistics, field, val) |
313 | 313 | ||
314 | extern void tcp_init_mem(struct net *net); | ||
315 | |||
314 | extern void tcp_v4_err(struct sk_buff *skb, u32); | 316 | extern void tcp_v4_err(struct sk_buff *skb, u32); |
315 | 317 | ||
316 | extern void tcp_shutdown (struct sock *sk, int how); | 318 | extern void tcp_shutdown (struct sock *sk, int how); |
diff --git a/net/caif/caif_dev.c b/net/caif/caif_dev.c index 673728add60b..82c57069415f 100644 --- a/net/caif/caif_dev.c +++ b/net/caif/caif_dev.c | |||
@@ -59,8 +59,6 @@ struct cfcnfg *get_cfcnfg(struct net *net) | |||
59 | { | 59 | { |
60 | struct caif_net *caifn; | 60 | struct caif_net *caifn; |
61 | caifn = net_generic(net, caif_net_id); | 61 | caifn = net_generic(net, caif_net_id); |
62 | if (!caifn) | ||
63 | return NULL; | ||
64 | return caifn->cfg; | 62 | return caifn->cfg; |
65 | } | 63 | } |
66 | EXPORT_SYMBOL(get_cfcnfg); | 64 | EXPORT_SYMBOL(get_cfcnfg); |
@@ -69,8 +67,6 @@ static struct caif_device_entry_list *caif_device_list(struct net *net) | |||
69 | { | 67 | { |
70 | struct caif_net *caifn; | 68 | struct caif_net *caifn; |
71 | caifn = net_generic(net, caif_net_id); | 69 | caifn = net_generic(net, caif_net_id); |
72 | if (!caifn) | ||
73 | return NULL; | ||
74 | return &caifn->caifdevs; | 70 | return &caifn->caifdevs; |
75 | } | 71 | } |
76 | 72 | ||
@@ -99,8 +95,6 @@ static struct caif_device_entry *caif_device_alloc(struct net_device *dev) | |||
99 | struct caif_device_entry *caifd; | 95 | struct caif_device_entry *caifd; |
100 | 96 | ||
101 | caifdevs = caif_device_list(dev_net(dev)); | 97 | caifdevs = caif_device_list(dev_net(dev)); |
102 | if (!caifdevs) | ||
103 | return NULL; | ||
104 | 98 | ||
105 | caifd = kzalloc(sizeof(*caifd), GFP_KERNEL); | 99 | caifd = kzalloc(sizeof(*caifd), GFP_KERNEL); |
106 | if (!caifd) | 100 | if (!caifd) |
@@ -120,8 +114,6 @@ static struct caif_device_entry *caif_get(struct net_device *dev) | |||
120 | struct caif_device_entry_list *caifdevs = | 114 | struct caif_device_entry_list *caifdevs = |
121 | caif_device_list(dev_net(dev)); | 115 | caif_device_list(dev_net(dev)); |
122 | struct caif_device_entry *caifd; | 116 | struct caif_device_entry *caifd; |
123 | if (!caifdevs) | ||
124 | return NULL; | ||
125 | 117 | ||
126 | list_for_each_entry_rcu(caifd, &caifdevs->list, list) { | 118 | list_for_each_entry_rcu(caifd, &caifdevs->list, list) { |
127 | if (caifd->netdev == dev) | 119 | if (caifd->netdev == dev) |
@@ -321,8 +313,6 @@ void caif_enroll_dev(struct net_device *dev, struct caif_dev_common *caifdev, | |||
321 | struct caif_device_entry_list *caifdevs; | 313 | struct caif_device_entry_list *caifdevs; |
322 | 314 | ||
323 | caifdevs = caif_device_list(dev_net(dev)); | 315 | caifdevs = caif_device_list(dev_net(dev)); |
324 | if (!cfg || !caifdevs) | ||
325 | return; | ||
326 | caifd = caif_device_alloc(dev); | 316 | caifd = caif_device_alloc(dev); |
327 | if (!caifd) | 317 | if (!caifd) |
328 | return; | 318 | return; |
@@ -374,8 +364,6 @@ static int caif_device_notify(struct notifier_block *me, unsigned long what, | |||
374 | 364 | ||
375 | cfg = get_cfcnfg(dev_net(dev)); | 365 | cfg = get_cfcnfg(dev_net(dev)); |
376 | caifdevs = caif_device_list(dev_net(dev)); | 366 | caifdevs = caif_device_list(dev_net(dev)); |
377 | if (!cfg || !caifdevs) | ||
378 | return 0; | ||
379 | 367 | ||
380 | caifd = caif_get(dev); | 368 | caifd = caif_get(dev); |
381 | if (caifd == NULL && dev->type != ARPHRD_CAIF) | 369 | if (caifd == NULL && dev->type != ARPHRD_CAIF) |
@@ -507,9 +495,6 @@ static struct notifier_block caif_device_notifier = { | |||
507 | static int caif_init_net(struct net *net) | 495 | static int caif_init_net(struct net *net) |
508 | { | 496 | { |
509 | struct caif_net *caifn = net_generic(net, caif_net_id); | 497 | struct caif_net *caifn = net_generic(net, caif_net_id); |
510 | if (WARN_ON(!caifn)) | ||
511 | return -EINVAL; | ||
512 | |||
513 | INIT_LIST_HEAD(&caifn->caifdevs.list); | 498 | INIT_LIST_HEAD(&caifn->caifdevs.list); |
514 | mutex_init(&caifn->caifdevs.lock); | 499 | mutex_init(&caifn->caifdevs.lock); |
515 | 500 | ||
@@ -527,9 +512,6 @@ static void caif_exit_net(struct net *net) | |||
527 | caif_device_list(net); | 512 | caif_device_list(net); |
528 | struct cfcnfg *cfg = get_cfcnfg(net); | 513 | struct cfcnfg *cfg = get_cfcnfg(net); |
529 | 514 | ||
530 | if (!cfg || !caifdevs) | ||
531 | return; | ||
532 | |||
533 | rtnl_lock(); | 515 | rtnl_lock(); |
534 | mutex_lock(&caifdevs->lock); | 516 | mutex_lock(&caifdevs->lock); |
535 | 517 | ||
@@ -569,7 +551,7 @@ static int __init caif_device_init(void) | |||
569 | { | 551 | { |
570 | int result; | 552 | int result; |
571 | 553 | ||
572 | result = register_pernet_device(&caif_net_ops); | 554 | result = register_pernet_subsys(&caif_net_ops); |
573 | 555 | ||
574 | if (result) | 556 | if (result) |
575 | return result; | 557 | return result; |
@@ -582,7 +564,7 @@ static int __init caif_device_init(void) | |||
582 | 564 | ||
583 | static void __exit caif_device_exit(void) | 565 | static void __exit caif_device_exit(void) |
584 | { | 566 | { |
585 | unregister_pernet_device(&caif_net_ops); | 567 | unregister_pernet_subsys(&caif_net_ops); |
586 | unregister_netdevice_notifier(&caif_device_notifier); | 568 | unregister_netdevice_notifier(&caif_device_notifier); |
587 | dev_remove_pack(&caif_packet_type); | 569 | dev_remove_pack(&caif_packet_type); |
588 | } | 570 | } |
diff --git a/net/caif/cfcnfg.c b/net/caif/cfcnfg.c index 598aafb4cb51..ba9cfd47778a 100644 --- a/net/caif/cfcnfg.c +++ b/net/caif/cfcnfg.c | |||
@@ -309,7 +309,6 @@ int caif_connect_client(struct net *net, struct caif_connect_request *conn_req, | |||
309 | int err; | 309 | int err; |
310 | struct cfctrl_link_param param; | 310 | struct cfctrl_link_param param; |
311 | struct cfcnfg *cfg = get_cfcnfg(net); | 311 | struct cfcnfg *cfg = get_cfcnfg(net); |
312 | caif_assert(cfg != NULL); | ||
313 | 312 | ||
314 | rcu_read_lock(); | 313 | rcu_read_lock(); |
315 | err = caif_connect_req_to_link_param(cfg, conn_req, ¶m); | 314 | err = caif_connect_req_to_link_param(cfg, conn_req, ¶m); |
diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c index aefcd7acbffa..0e950fda9a0a 100644 --- a/net/core/net_namespace.c +++ b/net/core/net_namespace.c | |||
@@ -30,6 +30,20 @@ EXPORT_SYMBOL(init_net); | |||
30 | 30 | ||
31 | #define INITIAL_NET_GEN_PTRS 13 /* +1 for len +2 for rcu_head */ | 31 | #define INITIAL_NET_GEN_PTRS 13 /* +1 for len +2 for rcu_head */ |
32 | 32 | ||
33 | static unsigned int max_gen_ptrs = INITIAL_NET_GEN_PTRS; | ||
34 | |||
35 | static struct net_generic *net_alloc_generic(void) | ||
36 | { | ||
37 | struct net_generic *ng; | ||
38 | size_t generic_size = offsetof(struct net_generic, ptr[max_gen_ptrs]); | ||
39 | |||
40 | ng = kzalloc(generic_size, GFP_KERNEL); | ||
41 | if (ng) | ||
42 | ng->len = max_gen_ptrs; | ||
43 | |||
44 | return ng; | ||
45 | } | ||
46 | |||
33 | static int net_assign_generic(struct net *net, int id, void *data) | 47 | static int net_assign_generic(struct net *net, int id, void *data) |
34 | { | 48 | { |
35 | struct net_generic *ng, *old_ng; | 49 | struct net_generic *ng, *old_ng; |
@@ -43,8 +57,7 @@ static int net_assign_generic(struct net *net, int id, void *data) | |||
43 | if (old_ng->len >= id) | 57 | if (old_ng->len >= id) |
44 | goto assign; | 58 | goto assign; |
45 | 59 | ||
46 | ng = kzalloc(sizeof(struct net_generic) + | 60 | ng = net_alloc_generic(); |
47 | id * sizeof(void *), GFP_KERNEL); | ||
48 | if (ng == NULL) | 61 | if (ng == NULL) |
49 | return -ENOMEM; | 62 | return -ENOMEM; |
50 | 63 | ||
@@ -59,7 +72,6 @@ static int net_assign_generic(struct net *net, int id, void *data) | |||
59 | * the old copy for kfree after a grace period. | 72 | * the old copy for kfree after a grace period. |
60 | */ | 73 | */ |
61 | 74 | ||
62 | ng->len = id; | ||
63 | memcpy(&ng->ptr, &old_ng->ptr, old_ng->len * sizeof(void*)); | 75 | memcpy(&ng->ptr, &old_ng->ptr, old_ng->len * sizeof(void*)); |
64 | 76 | ||
65 | rcu_assign_pointer(net->gen, ng); | 77 | rcu_assign_pointer(net->gen, ng); |
@@ -161,18 +173,6 @@ out_undo: | |||
161 | goto out; | 173 | goto out; |
162 | } | 174 | } |
163 | 175 | ||
164 | static struct net_generic *net_alloc_generic(void) | ||
165 | { | ||
166 | struct net_generic *ng; | ||
167 | size_t generic_size = sizeof(struct net_generic) + | ||
168 | INITIAL_NET_GEN_PTRS * sizeof(void *); | ||
169 | |||
170 | ng = kzalloc(generic_size, GFP_KERNEL); | ||
171 | if (ng) | ||
172 | ng->len = INITIAL_NET_GEN_PTRS; | ||
173 | |||
174 | return ng; | ||
175 | } | ||
176 | 176 | ||
177 | #ifdef CONFIG_NET_NS | 177 | #ifdef CONFIG_NET_NS |
178 | static struct kmem_cache *net_cachep; | 178 | static struct kmem_cache *net_cachep; |
@@ -483,6 +483,7 @@ again: | |||
483 | } | 483 | } |
484 | return error; | 484 | return error; |
485 | } | 485 | } |
486 | max_gen_ptrs = max_t(unsigned int, max_gen_ptrs, *ops->id); | ||
486 | } | 487 | } |
487 | error = __register_pernet_operations(list, ops); | 488 | error = __register_pernet_operations(list, ops); |
488 | if (error) { | 489 | if (error) { |
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index f16444bc6cbb..65aebd450027 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -1509,6 +1509,9 @@ errout: | |||
1509 | 1509 | ||
1510 | if (send_addr_notify) | 1510 | if (send_addr_notify) |
1511 | call_netdevice_notifiers(NETDEV_CHANGEADDR, dev); | 1511 | call_netdevice_notifiers(NETDEV_CHANGEADDR, dev); |
1512 | min_ifinfo_dump_size = max_t(u16, if_nlmsg_size(dev), | ||
1513 | min_ifinfo_dump_size); | ||
1514 | |||
1512 | return err; | 1515 | return err; |
1513 | } | 1516 | } |
1514 | 1517 | ||
diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c index 2e4e24476c4c..19d66cefd7d3 100644 --- a/net/ipv4/inet_connection_sock.c +++ b/net/ipv4/inet_connection_sock.c | |||
@@ -123,11 +123,14 @@ again: | |||
123 | smallest_size = tb->num_owners; | 123 | smallest_size = tb->num_owners; |
124 | smallest_rover = rover; | 124 | smallest_rover = rover; |
125 | if (atomic_read(&hashinfo->bsockets) > (high - low) + 1) { | 125 | if (atomic_read(&hashinfo->bsockets) > (high - low) + 1) { |
126 | spin_unlock(&head->lock); | ||
127 | snum = smallest_rover; | 126 | snum = smallest_rover; |
128 | goto have_snum; | 127 | goto tb_found; |
129 | } | 128 | } |
130 | } | 129 | } |
130 | if (!inet_csk(sk)->icsk_af_ops->bind_conflict(sk, tb)) { | ||
131 | snum = rover; | ||
132 | goto tb_found; | ||
133 | } | ||
131 | goto next; | 134 | goto next; |
132 | } | 135 | } |
133 | break; | 136 | break; |
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 2b53a1f7abf6..6b3ca5ba4450 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c | |||
@@ -422,6 +422,10 @@ static struct ip_tunnel *ipgre_tunnel_locate(struct net *net, | |||
422 | if (register_netdevice(dev) < 0) | 422 | if (register_netdevice(dev) < 0) |
423 | goto failed_free; | 423 | goto failed_free; |
424 | 424 | ||
425 | /* Can use a lockless transmit, unless we generate output sequences */ | ||
426 | if (!(nt->parms.o_flags & GRE_SEQ)) | ||
427 | dev->features |= NETIF_F_LLTX; | ||
428 | |||
425 | dev_hold(dev); | 429 | dev_hold(dev); |
426 | ipgre_tunnel_link(ign, nt); | 430 | ipgre_tunnel_link(ign, nt); |
427 | return nt; | 431 | return nt; |
diff --git a/net/ipv4/sysctl_net_ipv4.c b/net/ipv4/sysctl_net_ipv4.c index 4aa7e9dc0cbb..4cb9cd2f2c39 100644 --- a/net/ipv4/sysctl_net_ipv4.c +++ b/net/ipv4/sysctl_net_ipv4.c | |||
@@ -814,6 +814,7 @@ static __net_init int ipv4_sysctl_init_net(struct net *net) | |||
814 | 814 | ||
815 | net->ipv4.sysctl_rt_cache_rebuild_count = 4; | 815 | net->ipv4.sysctl_rt_cache_rebuild_count = 4; |
816 | 816 | ||
817 | tcp_init_mem(net); | ||
817 | limit = nr_free_buffer_pages() / 8; | 818 | limit = nr_free_buffer_pages() / 8; |
818 | limit = max(limit, 128UL); | 819 | limit = max(limit, 128UL); |
819 | net->ipv4.sysctl_tcp_mem[0] = limit / 4 * 3; | 820 | net->ipv4.sysctl_tcp_mem[0] = limit / 4 * 3; |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 9bcdec3ad772..06373b4a449a 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -3216,6 +3216,16 @@ static int __init set_thash_entries(char *str) | |||
3216 | } | 3216 | } |
3217 | __setup("thash_entries=", set_thash_entries); | 3217 | __setup("thash_entries=", set_thash_entries); |
3218 | 3218 | ||
3219 | void tcp_init_mem(struct net *net) | ||
3220 | { | ||
3221 | /* Set per-socket limits to no more than 1/128 the pressure threshold */ | ||
3222 | unsigned long limit = nr_free_buffer_pages() / 8; | ||
3223 | limit = max(limit, 128UL); | ||
3224 | net->ipv4.sysctl_tcp_mem[0] = limit / 4 * 3; | ||
3225 | net->ipv4.sysctl_tcp_mem[1] = limit; | ||
3226 | net->ipv4.sysctl_tcp_mem[2] = net->ipv4.sysctl_tcp_mem[0] * 2; | ||
3227 | } | ||
3228 | |||
3219 | void __init tcp_init(void) | 3229 | void __init tcp_init(void) |
3220 | { | 3230 | { |
3221 | struct sk_buff *skb = NULL; | 3231 | struct sk_buff *skb = NULL; |
@@ -3276,9 +3286,9 @@ void __init tcp_init(void) | |||
3276 | sysctl_tcp_max_orphans = cnt / 2; | 3286 | sysctl_tcp_max_orphans = cnt / 2; |
3277 | sysctl_max_syn_backlog = max(128, cnt / 256); | 3287 | sysctl_max_syn_backlog = max(128, cnt / 256); |
3278 | 3288 | ||
3279 | /* Set per-socket limits to no more than 1/128 the pressure threshold */ | 3289 | tcp_init_mem(&init_net); |
3280 | limit = ((unsigned long)init_net.ipv4.sysctl_tcp_mem[1]) | 3290 | limit = nr_free_buffer_pages() / 8; |
3281 | << (PAGE_SHIFT - 7); | 3291 | limit = max(limit, 128UL); |
3282 | max_share = min(4UL*1024*1024, limit); | 3292 | max_share = min(4UL*1024*1024, limit); |
3283 | 3293 | ||
3284 | sysctl_tcp_wmem[0] = SK_MEM_QUANTUM; | 3294 | sysctl_tcp_wmem[0] = SK_MEM_QUANTUM; |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 8c8de2780c7a..4ff3b6dc74fc 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -1141,11 +1141,9 @@ int tcp_trim_head(struct sock *sk, struct sk_buff *skb, u32 len) | |||
1141 | sk_mem_uncharge(sk, len); | 1141 | sk_mem_uncharge(sk, len); |
1142 | sock_set_flag(sk, SOCK_QUEUE_SHRUNK); | 1142 | sock_set_flag(sk, SOCK_QUEUE_SHRUNK); |
1143 | 1143 | ||
1144 | /* Any change of skb->len requires recalculation of tso | 1144 | /* Any change of skb->len requires recalculation of tso factor. */ |
1145 | * factor and mss. | ||
1146 | */ | ||
1147 | if (tcp_skb_pcount(skb) > 1) | 1145 | if (tcp_skb_pcount(skb) > 1) |
1148 | tcp_set_skb_tso_segs(sk, skb, tcp_current_mss(sk)); | 1146 | tcp_set_skb_tso_segs(sk, skb, tcp_skb_mss(skb)); |
1149 | 1147 | ||
1150 | return 0; | 1148 | return 0; |
1151 | } | 1149 | } |
diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c index d21e7ebd91ca..55670ec3cd0f 100644 --- a/net/l2tp/l2tp_ip.c +++ b/net/l2tp/l2tp_ip.c | |||
@@ -393,11 +393,6 @@ static int l2tp_ip_backlog_recv(struct sock *sk, struct sk_buff *skb) | |||
393 | { | 393 | { |
394 | int rc; | 394 | int rc; |
395 | 395 | ||
396 | if (!xfrm4_policy_check(sk, XFRM_POLICY_IN, skb)) | ||
397 | goto drop; | ||
398 | |||
399 | nf_reset(skb); | ||
400 | |||
401 | /* Charge it to the socket, dropping if the queue is full. */ | 396 | /* Charge it to the socket, dropping if the queue is full. */ |
402 | rc = sock_queue_rcv_skb(sk, skb); | 397 | rc = sock_queue_rcv_skb(sk, skb); |
403 | if (rc < 0) | 398 | if (rc < 0) |
diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index b3d76b756cd5..a4643969a13b 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c | |||
@@ -106,6 +106,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata, | |||
106 | 106 | ||
107 | sdata->drop_unencrypted = capability & WLAN_CAPABILITY_PRIVACY ? 1 : 0; | 107 | sdata->drop_unencrypted = capability & WLAN_CAPABILITY_PRIVACY ? 1 : 0; |
108 | 108 | ||
109 | local->oper_channel = chan; | ||
109 | channel_type = ifibss->channel_type; | 110 | channel_type = ifibss->channel_type; |
110 | if (channel_type > NL80211_CHAN_HT20 && | 111 | if (channel_type > NL80211_CHAN_HT20 && |
111 | !cfg80211_can_beacon_sec_chan(local->hw.wiphy, chan, channel_type)) | 112 | !cfg80211_can_beacon_sec_chan(local->hw.wiphy, chan, channel_type)) |
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index e47768cb8cb3..01a21c2f6ab3 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c | |||
@@ -1314,6 +1314,7 @@ u32 __ieee80211_recalc_idle(struct ieee80211_local *local) | |||
1314 | continue; | 1314 | continue; |
1315 | } | 1315 | } |
1316 | /* count everything else */ | 1316 | /* count everything else */ |
1317 | sdata->vif.bss_conf.idle = false; | ||
1317 | count++; | 1318 | count++; |
1318 | } | 1319 | } |
1319 | 1320 | ||
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index aad8fb699989..85d3bb7490aa 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
@@ -1918,7 +1918,7 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1918 | struct sk_buff *skb; | 1918 | struct sk_buff *skb; |
1919 | 1919 | ||
1920 | unix_state_lock(sk); | 1920 | unix_state_lock(sk); |
1921 | skb = skb_dequeue(&sk->sk_receive_queue); | 1921 | skb = skb_peek(&sk->sk_receive_queue); |
1922 | if (skb == NULL) { | 1922 | if (skb == NULL) { |
1923 | unix_sk(sk)->recursion_level = 0; | 1923 | unix_sk(sk)->recursion_level = 0; |
1924 | if (copied >= target) | 1924 | if (copied >= target) |
@@ -1958,11 +1958,8 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1958 | if (check_creds) { | 1958 | if (check_creds) { |
1959 | /* Never glue messages from different writers */ | 1959 | /* Never glue messages from different writers */ |
1960 | if ((UNIXCB(skb).pid != siocb->scm->pid) || | 1960 | if ((UNIXCB(skb).pid != siocb->scm->pid) || |
1961 | (UNIXCB(skb).cred != siocb->scm->cred)) { | 1961 | (UNIXCB(skb).cred != siocb->scm->cred)) |
1962 | skb_queue_head(&sk->sk_receive_queue, skb); | ||
1963 | sk->sk_data_ready(sk, skb->len); | ||
1964 | break; | 1962 | break; |
1965 | } | ||
1966 | } else { | 1963 | } else { |
1967 | /* Copy credentials */ | 1964 | /* Copy credentials */ |
1968 | scm_set_cred(siocb->scm, UNIXCB(skb).pid, UNIXCB(skb).cred); | 1965 | scm_set_cred(siocb->scm, UNIXCB(skb).pid, UNIXCB(skb).cred); |
@@ -1977,8 +1974,6 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1977 | 1974 | ||
1978 | chunk = min_t(unsigned int, skb->len, size); | 1975 | chunk = min_t(unsigned int, skb->len, size); |
1979 | if (memcpy_toiovec(msg->msg_iov, skb->data, chunk)) { | 1976 | if (memcpy_toiovec(msg->msg_iov, skb->data, chunk)) { |
1980 | skb_queue_head(&sk->sk_receive_queue, skb); | ||
1981 | sk->sk_data_ready(sk, skb->len); | ||
1982 | if (copied == 0) | 1977 | if (copied == 0) |
1983 | copied = -EFAULT; | 1978 | copied = -EFAULT; |
1984 | break; | 1979 | break; |
@@ -1993,13 +1988,10 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
1993 | if (UNIXCB(skb).fp) | 1988 | if (UNIXCB(skb).fp) |
1994 | unix_detach_fds(siocb->scm, skb); | 1989 | unix_detach_fds(siocb->scm, skb); |
1995 | 1990 | ||
1996 | /* put the skb back if we didn't use it up.. */ | 1991 | if (skb->len) |
1997 | if (skb->len) { | ||
1998 | skb_queue_head(&sk->sk_receive_queue, skb); | ||
1999 | sk->sk_data_ready(sk, skb->len); | ||
2000 | break; | 1992 | break; |
2001 | } | ||
2002 | 1993 | ||
1994 | skb_unlink(skb, &sk->sk_receive_queue); | ||
2003 | consume_skb(skb); | 1995 | consume_skb(skb); |
2004 | 1996 | ||
2005 | if (siocb->scm->fp) | 1997 | if (siocb->scm->fp) |
@@ -2010,9 +2002,6 @@ static int unix_stream_recvmsg(struct kiocb *iocb, struct socket *sock, | |||
2010 | if (UNIXCB(skb).fp) | 2002 | if (UNIXCB(skb).fp) |
2011 | siocb->scm->fp = scm_fp_dup(UNIXCB(skb).fp); | 2003 | siocb->scm->fp = scm_fp_dup(UNIXCB(skb).fp); |
2012 | 2004 | ||
2013 | /* put message back and return */ | ||
2014 | skb_queue_head(&sk->sk_receive_queue, skb); | ||
2015 | sk->sk_data_ready(sk, skb->len); | ||
2016 | break; | 2005 | break; |
2017 | } | 2006 | } |
2018 | } while (size); | 2007 | } while (size); |