This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Harald Welte gerrit-no-reply at lists.osmocom.orgHarald Welte has submitted this change and it was merged.
Change subject: osmo_sock_init2(): Fix creation of non-bound sockets
......................................................................
osmo_sock_init2(): Fix creation of non-bound sockets
If osmo_sock_init2() was used with CONNECT flag but without BIND
flag, an invalid check for "did we create a socket yet" caused
the socket to never be created, and subsequently the entire function
to return an error.
Change-Id: I0206dbb9c5b8f74d7fb088576941b092acd2ca22
---
M src/socket.c
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified
diff --git a/src/socket.c b/src/socket.c
index ca50b6f..457c991 100644
--- a/src/socket.c
+++ b/src/socket.c
@@ -239,7 +239,7 @@
 				rp->ai_protocol = proto;
 			}
 
-			if (!sfd) {
+			if (sfd < 0) {
 				sfd = socket_helper(rp, flags);
 				if (sfd < 0)
 					continue;
-- 
To view, visit https://gerrit.osmocom.org/3333
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I0206dbb9c5b8f74d7fb088576941b092acd2ca22
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder