From mboxrd@z Thu Jan 1 00:00:00 1970 From: ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org (Eric W. Biederman) Subject: Re: [patch 0/1][NETNS49] Make af_unix autobind per namespace Date: Wed, 03 Oct 2007 08:36:53 -0600 Message-ID: References: <20071002151846.827206013@mai.toulouse-stg.fr.ibm.com> <4702AF67.1010707@fr.ibm.com> <47034F4F.5000901@sw.ru> <47039510.7040001@fr.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: In-Reply-To: <47039510.7040001-NmTC/0ZBporQT0dZR+AlfA@public.gmane.org> (Cedric Le Goater's message of "Wed, 03 Oct 2007 15:11:44 +0200") List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Cedric Le Goater Cc: containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org, den-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org, benjamin.thery-6ktuUTfB/bM@public.gmane.org, "Denis V. Lunev" List-Id: containers.vger.kernel.org Cedric Le Goater 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. > 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