aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/proto.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/dccp/proto.c')
-rw-r--r--net/dccp/proto.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index a156319fd0ac..671cd1413d59 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -278,7 +278,7 @@ int dccp_disconnect(struct sock *sk, int flags)
278 sk->sk_send_head = NULL; 278 sk->sk_send_head = NULL;
279 } 279 }
280 280
281 inet->dport = 0; 281 inet->inet_dport = 0;
282 282
283 if (!(sk->sk_userlocks & SOCK_BINDADDR_LOCK)) 283 if (!(sk->sk_userlocks & SOCK_BINDADDR_LOCK))
284 inet_reset_saddr(sk); 284 inet_reset_saddr(sk);
@@ -290,7 +290,7 @@ int dccp_disconnect(struct sock *sk, int flags)
290 inet_csk_delack_init(sk); 290 inet_csk_delack_init(sk);
291 __sk_dst_reset(sk); 291 __sk_dst_reset(sk);
292 292
293 WARN_ON(inet->num && !icsk->icsk_bind_hash); 293 WARN_ON(inet->inet_num && !icsk->icsk_bind_hash);
294 294
295 sk->sk_error_report(sk); 295 sk->sk_error_report(sk);
296 return err; 296 return err;
@@ -1060,11 +1060,12 @@ static int __init dccp_init(void)
1060 for (ehash_order = 0; (1UL << ehash_order) < goal; ehash_order++) 1060 for (ehash_order = 0; (1UL << ehash_order) < goal; ehash_order++)
1061 ; 1061 ;
1062 do { 1062 do {
1063 dccp_hashinfo.ehash_size = (1UL << ehash_order) * PAGE_SIZE / 1063 unsigned long hash_size = (1UL << ehash_order) * PAGE_SIZE /
1064 sizeof(struct inet_ehash_bucket); 1064 sizeof(struct inet_ehash_bucket);
1065 while (dccp_hashinfo.ehash_size & 1065
1066 (dccp_hashinfo.ehash_size - 1)) 1066 while (hash_size & (hash_size - 1))
1067 dccp_hashinfo.ehash_size--; 1067 hash_size--;
1068 dccp_hashinfo.ehash_mask = hash_size - 1;
1068 dccp_hashinfo.ehash = (struct inet_ehash_bucket *) 1069 dccp_hashinfo.ehash = (struct inet_ehash_bucket *)
1069 __get_free_pages(GFP_ATOMIC|__GFP_NOWARN, ehash_order); 1070 __get_free_pages(GFP_ATOMIC|__GFP_NOWARN, ehash_order);
1070 } while (!dccp_hashinfo.ehash && --ehash_order > 0); 1071 } while (!dccp_hashinfo.ehash && --ehash_order > 0);
@@ -1074,7 +1075,7 @@ static int __init dccp_init(void)
1074 goto out_free_bind_bucket_cachep; 1075 goto out_free_bind_bucket_cachep;
1075 } 1076 }
1076 1077
1077 for (i = 0; i < dccp_hashinfo.ehash_size; i++) { 1078 for (i = 0; i <= dccp_hashinfo.ehash_mask; i++) {
1078 INIT_HLIST_NULLS_HEAD(&dccp_hashinfo.ehash[i].chain, i); 1079 INIT_HLIST_NULLS_HEAD(&dccp_hashinfo.ehash[i].chain, i);
1079 INIT_HLIST_NULLS_HEAD(&dccp_hashinfo.ehash[i].twchain, i); 1080 INIT_HLIST_NULLS_HEAD(&dccp_hashinfo.ehash[i].twchain, i);
1080 } 1081 }
@@ -1153,7 +1154,7 @@ static void __exit dccp_fini(void)
1153 get_order(dccp_hashinfo.bhash_size * 1154 get_order(dccp_hashinfo.bhash_size *
1154 sizeof(struct inet_bind_hashbucket))); 1155 sizeof(struct inet_bind_hashbucket)));
1155 free_pages((unsigned long)dccp_hashinfo.ehash, 1156 free_pages((unsigned long)dccp_hashinfo.ehash,
1156 get_order(dccp_hashinfo.ehash_size * 1157 get_order((dccp_hashinfo.ehash_mask + 1) *
1157 sizeof(struct inet_ehash_bucket))); 1158 sizeof(struct inet_ehash_bucket)));
1158 inet_ehash_locks_free(&dccp_hashinfo); 1159 inet_ehash_locks_free(&dccp_hashinfo);
1159 kmem_cache_destroy(dccp_hashinfo.bind_bucket_cachep); 1160 kmem_cache_destroy(dccp_hashinfo.bind_bucket_cachep);