Subject: Re: [PATCH 09/14] Phonet: allocate and initialize new sockets

From: Pavel Emelyanov <[email-masked]>
Date: Tue, 16 Sep 2008 22:42:52 +0400

> @@ -71,8 +73,22 @@ static int pn_socket_create(struct net *net, struct socket *sock, int protocol)
>  		goto out;
>  	}
>  
> -	/* TODO: create and init the struct sock */
> -	err = -EPROTONOSUPPORT;
> +	sk = sk_alloc(net, PF_PHONET, GFP_KERNEL, pnp->prot);
> +	if (sk == NULL) {
> +		err = -ENOMEM;
> +		goto out;
> +	}

This turns to be a little bit messy wrt net namespaces.
Look - you allow for sockets to be created (and isolated from each
other) in each namespace, the list of devices is global, whilst
the sysctls are visible in init_net only...

I'd propose to either make this protocol namespaces aware from the
very beginning or to explicitly prohibit any operations with it in
the non-init netns not to forget to fix it in the future (just like
it was done for all the protocols and is still true for most of them).

Thanks,
Pavel