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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <sys/socket.h>
#include <sys/un.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <stdio.h>

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;
}
_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/containers

[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux