[PATCH] test getifaddrs()

2016-10-26 Thread Nadav Har'El
Add rudimentary test for getifaddrs(). Tests, for example, that we have two loopback interfaces - one with AF_INET and one with AF_PACKET. The test can run on both OSv and Linux. Additionally prints out some information on the available interfaces, which can be useful in manual testing. Signed-of

[COMMIT osv master] libc/getifaddrs: Extract and use allocate_and_add_ifaddrs

2016-10-26 Thread Commit Bot
From: Benoît Canet Committer: Nadav Har'El Branch: master libc/getifaddrs: Extract and use allocate_and_add_ifaddrs The code will need to allocate twice as much ifaddr_storage structure to be able to return mac addresses in their own ifaddrs structure. Signed-off-by: Benoît Canet Message-Id:

[COMMIT osv master] libc: Move getifaddrs.c from musl to libc.

2016-10-26 Thread Commit Bot
From: Benoît Canet Committer: Nadav Har'El Branch: master libc: Move getifaddrs.c from musl to libc. Signed-off-by: Benoît Canet Message-Id: <1477485154-13682-2-git-send-email-ben...@scylladb.com> --- diff --git a/Makefile b/Makefile --- a/Makefile +++ b/Makefile @@ -1354,7 +1354,7 @@ musl +

[COMMIT osv master] libc/getifaddrs: Also return ifaddrs with ether hw addresses

2016-10-26 Thread Commit Bot
From: Benoît Canet Committer: Nadav Har'El Branch: master libc/getifaddrs: Also return ifaddrs with ether hw addresses Before this patch, OSv's getifaddrs() returns for each network interface a single entry, with the AF_INET address family and sockaddr_in address type. Linux's getifaddrs() re

[COMMIT osv master] uipc_socket.cc: prevent use after free bug in soisdisconnected

2016-10-26 Thread Commit Bot
From: Timmons C. Player Committer: Nadav Har'El Branch: master uipc_socket.cc: prevent use after free bug in soisdisconnected Simultaneously closing a socket from both the network and user space sides can trigger a use after free bug in soisdisconnected. This change uses the existing socket re

Re: [PATCH v2 3/3] libc/getifaddrs: Also return ifaddrs with ether hw addresses

2016-10-26 Thread Nadav Har'El
On Wed, Oct 26, 2016 at 3:27 PM, Benoît Canet wrote: > > > On Wed, Oct 26, 2016 at 2:03 PM, Nadav Har'El wrote: > >> >> >> Shouldn't we also skip non-AF_INET interfaces, like loopback? >> > > 127.0.0.1 look totally like an IPV4 address so it's AF_INET. > Hmm, You're right. So in OSv we have no

[PATCH v3 3/3] libc/getifaddrs: Also return ifaddrs with ether hw addresses

2016-10-26 Thread Benoît Canet
Add these structure add the end of the list after the INET and INET6 addresses are filled. Signed-off-by: Benoît Canet --- libc/network/getifaddrs.c | 71 --- 1 file changed, 67 insertions(+), 4 deletions(-) diff --git a/libc/network/getifaddrs.c b/li

[PATCH v3 0/3] Make node.js runtime work

2016-10-26 Thread Benoît Canet
Add sockaddr_ll in the soa union to make room for hw addresses. Benoît Canet (3): libc: Move getifaddrs.c from musl to libc. libc/getifaddrs: Extract and use allocate_and_add_ifaddrs libc/getifaddrs: Also return ifaddrs with ether hw addresses Makefile | 2 +- libc/netwo

[PATCH v3 2/3] libc/getifaddrs: Extract and use allocate_and_add_ifaddrs

2016-10-26 Thread Benoît Canet
The code will need to allocate twice as much ifaddr_storage structure to be able to return mac addresses in their own ifaddrs structure. Signed-off-by: Benoît Canet --- libc/network/getifaddrs.c | 21 +++-- 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/libc/netwo

[PATCH v3 1/3] libc: Move getifaddrs.c from musl to libc.

2016-10-26 Thread Benoît Canet
Signed-off-by: Benoît Canet --- Makefile | 2 +- libc/network/getifaddrs.c | 180 ++ 2 files changed, 181 insertions(+), 1 deletion(-) create mode 100644 libc/network/getifaddrs.c diff --git a/Makefile b/Makefile index e294a03..03b0

Re: [PATCH v2 3/3] libc/getifaddrs: Also return ifaddrs with ether hw addresses

2016-10-26 Thread Benoît Canet
On Wed, Oct 26, 2016 at 2:03 PM, Nadav Har'El wrote: > Please add "Fixes #787" to the commit message. > > Thanks, the patch looks mostly correct, but one question below. > > On Wed, Oct 26, 2016 at 2:33 PM, Benoît Canet com> wrote: > >> Add these structure add the end of the list after the >> IN

Re: [PATCH v2 3/3] libc/getifaddrs: Also return ifaddrs with ether hw addresses

2016-10-26 Thread Nadav Har'El
Please add "Fixes #787" to the commit message. Thanks, the patch looks mostly correct, but one question below. On Wed, Oct 26, 2016 at 2:33 PM, Benoît Canet < benoit.canet.cont...@gmail.com> wrote: > Add these structure add the end of the list after the > INET and INET6 addresses are filled. > >

[PATCH v2 1/3] libc: Move getifaddrs.c from musl to libc.

2016-10-26 Thread Benoît Canet
Signed-off-by: Benoît Canet --- Makefile | 2 +- libc/network/getifaddrs.c | 180 ++ 2 files changed, 181 insertions(+), 1 deletion(-) create mode 100644 libc/network/getifaddrs.c diff --git a/Makefile b/Makefile index e294a03..03b0

[PATCH v2 2/3] libc/getifaddrs: Extract and use allocate_and_add_ifaddrs

2016-10-26 Thread Benoît Canet
The code will need to allocate twice as much ifaddr_storage structure to be able to return mac addresses in their own ifaddrs structure. Signed-off-by: Benoît Canet --- libc/network/getifaddrs.c | 21 +++-- 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/libc/netwo

[PATCH v2 0/3] Make node.js runtime work

2016-10-26 Thread Benoît Canet
Should make node.js work by returning the right structure filled with mac addresses. Benoît Canet (3): libc: Move getifaddrs.c from musl to libc. libc/getifaddrs: Extract and use allocate_and_add_ifaddrs libc/getifaddrs: Also return ifaddrs with ether hw addresses Makefile

[PATCH v2 3/3] libc/getifaddrs: Also return ifaddrs with ether hw addresses

2016-10-26 Thread Benoît Canet
Add these structure add the end of the list after the INET and INET6 addresses are filled. Signed-off-by: Benoît Canet --- libc/network/getifaddrs.c | 70 --- 1 file changed, 66 insertions(+), 4 deletions(-) diff --git a/libc/network/getifaddrs.c b/li