[NET]: Forget the zero_it argument of sk_alloc()
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / net / sctp / protocol.c
index 30929e3ca05a76f48920d8b530431e8b4e79d4a8..40c1a47d1b8dc2972abcf481dc42c5d30ed55229 100644 (file)
@@ -84,9 +84,9 @@ static struct sctp_af *sctp_af_v6_specific;
 struct kmem_cache *sctp_chunk_cachep __read_mostly;
 struct kmem_cache *sctp_bucket_cachep __read_mostly;
 
-extern int sysctl_sctp_mem[3];
-extern int sysctl_sctp_rmem[3];
-extern int sysctl_sctp_wmem[3];
+int sysctl_sctp_mem[3];
+int sysctl_sctp_rmem[3];
+int sysctl_sctp_wmem[3];
 
 /* Return the address of the control sock. */
 struct sock *sctp_get_ctl_sock(void)
@@ -179,7 +179,7 @@ static void sctp_get_local_addr_list(void)
        struct sctp_af *af;
 
        read_lock(&dev_base_lock);
-       for_each_netdev(dev) {
+       for_each_netdev(&init_net, dev) {
                __list_for_each(pos, &sctp_address_families) {
                        af = list_entry(pos, struct sctp_af, list);
                        af->copy_addrlist(&sctp_local_addr_list, dev);
@@ -552,7 +552,8 @@ static struct sock *sctp_v4_create_accept_sk(struct sock *sk,
 {
        struct inet_sock *inet = inet_sk(sk);
        struct inet_sock *newinet;
-       struct sock *newsk = sk_alloc(PF_INET, GFP_KERNEL, sk->sk_prot, 1);
+       struct sock *newsk = sk_alloc(sk->sk_net, PF_INET, GFP_KERNEL,
+                       sk->sk_prot);
 
        if (!newsk)
                goto out;
@@ -1172,9 +1173,6 @@ SCTP_STATIC __init int sctp_init(void)
                sctp_port_hashtable[i].chain = NULL;
        }
 
-       spin_lock_init(&sctp_port_alloc_lock);
-       sctp_port_rover = sysctl_local_port_range[0] - 1;
-
        printk(KERN_INFO "SCTP: Hash tables configured "
                         "(established %d bind %d)\n",
                sctp_assoc_hashsize, sctp_port_hashsize);
@@ -1185,6 +1183,9 @@ SCTP_STATIC __init int sctp_init(void)
        /* Enable PR-SCTP by default. */
        sctp_prsctp_enable = 1;
 
+       /* Disable AUTH by default. */
+       sctp_auth_enable = 0;
+
        sctp_sysctl_register();
 
        INIT_LIST_HEAD(&sctp_address_families);
@@ -1228,7 +1229,6 @@ SCTP_STATIC __init int sctp_init(void)
        if (status)
                goto err_v6_add_protocol;
 
-       __unsafe(THIS_MODULE);
        status = 0;
 out:
        return status;