X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Fcore%2Frequest_sock.c;h=98f0fc923f9195326ed9d0fe538e58fd7528d8d7;hb=987b0145d94eecf292d8b301228356f44611ab7c;hp=79ebd75fbe4dec5c57ddd34c4501c5858b04d8fb;hpb=f7ed79d23a47594e7834d66a8f14449796d4f3e6;p=linux-2.6.git diff --git a/net/core/request_sock.c b/net/core/request_sock.c index 79ebd75fb..98f0fc923 100644 --- a/net/core/request_sock.c +++ b/net/core/request_sock.c @@ -38,18 +38,20 @@ int reqsk_queue_alloc(struct request_sock_queue *queue, { const int lopt_size = sizeof(struct listen_sock) + nr_table_entries * sizeof(struct request_sock *); - struct listen_sock *lopt = kzalloc(lopt_size, GFP_KERNEL); + struct listen_sock *lopt = kmalloc(lopt_size, GFP_KERNEL); if (lopt == NULL) return -ENOMEM; + memset(lopt, 0, lopt_size); + for (lopt->max_qlen_log = 6; (1 << lopt->max_qlen_log) < sysctl_max_syn_backlog; lopt->max_qlen_log++); get_random_bytes(&lopt->hash_rnd, sizeof(lopt->hash_rnd)); rwlock_init(&queue->syn_wait_lock); - queue->rskq_accept_head = NULL; + queue->rskq_accept_head = queue->rskq_accept_head = NULL; lopt->nr_table_entries = nr_table_entries; write_lock_bh(&queue->syn_wait_lock);