From 41ca7ff9569b9fd04d38656047aa894f379db3a2 Mon Sep 17 00:00:00 2001 From: rtlsdrblog Date: Mon, 28 Aug 2023 22:35:49 +1200 Subject: [PATCH] fix rtl_tcp on macos --- src/rtl_tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rtl_tcp.c b/src/rtl_tcp.c index 588ca97..772a403 100644 --- a/src/rtl_tcp.c +++ b/src/rtl_tcp.c @@ -571,7 +571,7 @@ int main(int argc, char **argv) setsockopt(listensocket, SOL_SOCKET, SO_REUSEADDR, (char *)&r, sizeof(int)); setsockopt(listensocket, SOL_SOCKET, SO_LINGER, (char *)&ling, sizeof(ling)); - if (bind(listensocket, (struct sockaddr *)&local, sizeof(local))) + if (bind(listensocket, (struct sockaddr *)&local, aiHead->ai_addrlen)) fprintf(stderr, "rtl_tcp bind error: %s", strerror(errno)); else break;