[riot-notifications] [RIOT-OS/RIOT] POSIX TCP API: bad file descriptor (#11212)

Felipe Lalanne notifications at github.com
Fri May 24 06:10:07 CEST 2019

Hi Martine. Yes, you're right that the description is unclear. 

What I meant is that I get the same results on samr21-xpro and iotlab-m3 BEFORE performing the following change (i think it's a bug)

diff --git a/sys/posix/sockets/posix_sockets.c b/sys/posix/sockets/posix_sockets.c
index ae7195b32..8c7f16708 100644
--- a/sys/posix/sockets/posix_sockets.c
+++ b/sys/posix/sockets/posix_sockets.c
@@ -222,6 +222,7 @@ static int _sockaddr_to_ep(const struct sockaddr *address, socklen_t address_len
             struct sockaddr_in *in_addr = (struct sockaddr_in *)address;
             out->family = AF_INET;
+            out->netif = SOCK_ADDR_ANY_NETIF;
             out->addr.ipv4_u32 = in_addr->sin_addr.s_addr;
             out->port = ntohs(in_addr->sin_port);
@@ -233,6 +234,7 @@ static int _sockaddr_to_ep(const struct sockaddr *address, socklen_t address_len
             struct sockaddr_in6 *in6_addr = (struct sockaddr_in6 *)address;
             out->family = AF_INET6;
+            out->netif = SOCK_ADDR_ANY_NETIF;
             memcpy(&out->addr.ipv6, &in6_addr->sin6_addr, sizeof(out->addr.ipv6));
             out->port = ntohs(in6_addr->sin6_port);

AFTER the change, I get a different error: "Bad file descriptor" on iotlab-m3 and native, and "hardfault" on samr21-xpro.

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190523/614ef2bf/attachment.html>

More information about the notifications mailing list