[Devel] Re: [patch 0/1][NETNS49] Make af_unix autobind per namespace

Cedric Le Goater clg at fr.ibm.com
Wed Oct 3 08:34:10 PDT 2007


Eric W. Biederman wrote:
> Cedric Le Goater <clg at fr.ibm.com> writes:
>> my 2 cnts,
>>
>> when 'restarting' a socket bound to an abstract name, we will have 
>> a EADDRINUSE if we try to rebind it to an abtract name which is 
>> already in use by a socket in a another namespace ? 
> 
> No.

ok. i just went over your AF_UNIX patch and saw that 'struct net' was 
being checked for abstract sockets.

C.

>> it seems to me that this is an identifier and like any identifier
>> it should be private to the namespace, which probably means having
>> unix_abstract_socket_table[] per net namespace.
> 
> Yes it is.  It is a hash table so we are filter the hash chain
> and not having two copies of the table.  But effectively it's
> the same thing.
> 
> All this patch was suggesting was having a per network namespace
> copy of the data structure for the random number generator for
> generating the name.  
> 
> The ``random number generator'' is just a 16bit counter that loops
> through all 64k values seeing if a name is available and if so
> using it.  Sharing our place in the loop between different namespaces
> may be ineffeicient but it should work fine.
> 
> Eric

_______________________________________________
Containers mailing list
Containers at lists.linux-foundation.org
https://lists.linux-foundation.org/mailman/listinfo/containers




More information about the Devel mailing list