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: fix signed/unsigned bug in ipa_client_conn_open()
......................................................................
fix signed/unsigned bug in ipa_client_conn_open()
If osmo_sock_init() would ever return a negative FD together with
errno == EINPROGRESS, we would have attempted to register that negative
FD with the select() main loop handling, whihc of course doesn't work.
EINPROGRESS for a non-blocking connecting socket is handled inside
osmo_sock_init() and would result in it returning a positive FD, so the
above case is of theoretical significance only.
Change-Id: Id01eb0d48eea6cab1fbc720c52361101b8ea4e35
Fixes: Coverity CID 57856
---
M src/input/ipa.c
1 file changed, 2 insertions(+), 4 deletions(-)
Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified
diff --git a/src/input/ipa.c b/src/input/ipa.c
index f90d62c..ce155ce 100644
--- a/src/input/ipa.c
+++ b/src/input/ipa.c
@@ -213,10 +213,8 @@
 	ret = osmo_sock_init(AF_INET, SOCK_STREAM, IPPROTO_TCP,
 			     link->addr, link->port,
 			     OSMO_SOCK_F_CONNECT|OSMO_SOCK_F_NONBLOCK);
-	if (ret < 0) {
-		if (errno != EINPROGRESS)
-			return ret;
-	}
+	if (ret < 0)
+		return ret;
 	link->ofd->fd = ret;
 	link->ofd->when |= BSC_FD_WRITE;
 	if (osmo_fd_register(link->ofd) < 0) {
-- 
To view, visit https://gerrit.osmocom.org/1286
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Id01eb0d48eea6cab1fbc720c52361101b8ea4e35
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder