Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78373
b: refs/heads/master
c: b8e1f9b
h: refs/heads/master
i:
  78371: d0099fa
v: v3
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Jan 28, 2008
1 parent 19f6dfd commit 4b203c8
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 790a35328991b01181ff5624bdb084053b6fac54
refs/heads/master: b8e1f9b5c37e77cc8f978a58859b35fe5edd5542
1 change: 0 additions & 1 deletion trunk/include/linux/socket.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ struct __kernel_sockaddr_storage {
#include <linux/types.h> /* pid_t */
#include <linux/compiler.h> /* __user */

extern int sysctl_somaxconn;
#ifdef CONFIG_PROC_FS
struct seq_file;
extern void socket_seq_show(struct seq_file *seq);
Expand Down
1 change: 1 addition & 0 deletions trunk/include/net/net_namespace.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ struct net {

/* core sysctls */
struct ctl_table_header *sysctl_core_hdr;
int sysctl_somaxconn;

/* List of all packet sockets. */
rwlock_t packet_sklist_lock;
Expand Down
4 changes: 3 additions & 1 deletion trunk/net/core/sysctl_net_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ static struct ctl_table net_core_table[] = {
{
.ctl_name = NET_CORE_SOMAXCONN,
.procname = "somaxconn",
.data = &sysctl_somaxconn,
.data = &init_net.sysctl_somaxconn,
.maxlen = sizeof(int),
.mode = 0644,
.proc_handler = &proc_dointvec
Expand Down Expand Up @@ -161,6 +161,8 @@ static __net_init int sysctl_core_net_init(struct net *net)
{
struct ctl_table *tbl, *tmp;

net->sysctl_somaxconn = SOMAXCONN;

tbl = net_core_table;
if (net != &init_net) {
tbl = kmemdup(tbl, sizeof(net_core_table), GFP_KERNEL);
Expand Down
8 changes: 4 additions & 4 deletions trunk/net/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -1365,17 +1365,17 @@ asmlinkage long sys_bind(int fd, struct sockaddr __user *umyaddr, int addrlen)
* ready for listening.
*/

int sysctl_somaxconn __read_mostly = SOMAXCONN;

asmlinkage long sys_listen(int fd, int backlog)
{
struct socket *sock;
int err, fput_needed;
int somaxconn;

sock = sockfd_lookup_light(fd, &err, &fput_needed);
if (sock) {
if ((unsigned)backlog > sysctl_somaxconn)
backlog = sysctl_somaxconn;
somaxconn = sock->sk->sk_net->sysctl_somaxconn;
if ((unsigned)backlog > somaxconn)
backlog = somaxconn;

err = security_socket_listen(sock, backlog);
if (!err)
Expand Down

0 comments on commit 4b203c8

Please sign in to comment.