From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Lezcano Subject: Re: [patch 0/1][NETNS49] Make af_unix autobind per namespace Date: Tue, 02 Oct 2007 17:31:52 +0200 Message-ID: <47026468.5030400@fr.ibm.com> References: <20071002151846.827206013@mai.toulouse-stg.fr.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20071002151846.827206013-WECHFHqYCmGD/CxQmPlnQ0FT0OZdM7KVQQ4Iyu8u01E@public.gmane.org> 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: Daniel Lezcano Cc: containers-qjLDD68F18O7TbgM5vRIOg@public.gmane.org, den-GEFAQzZX7r8dnm+yROfE0A@public.gmane.org, ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org, benjamin.thery-6ktuUTfB/bM@public.gmane.org List-Id: containers.vger.kernel.org Daniel Lezcano wrote: > The following patch change autobind fonction to use the ordernum > from the network namespace instead of using the local static variable. > I forgot to add this trivial program which does autobind. --- #include #include #include #include #include #include int main(int argc, char* argv[]) { int fd; struct sockaddr_un addr; fd = socket(PF_UNIX, SOCK_DGRAM, 0); if (fd == -1) { perror("socket"); return 1; } memset(&addr, 0, sizeof(addr)); addr.sun_family = AF_UNIX; strcpy(addr.sun_path, ""); if (bind(fd, &addr, sizeof(short))) { perror("bind"); return 1; } return 0; }