aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libbsc
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-11-26 14:13:33 +0100
committerHarald Welte <laforge@gnumonks.org>2016-11-26 17:10:29 +0100
commit487436138e3dca6a99862abc779ac5230c8f826b (patch)
tree6fa8ff36b0c4b8a4b0b7c9c2a53f95b4de55c30e /openbsc/src/libbsc
parentbe67050a360dd196203b63e7320fbc7608dfa400 (diff)
bsc_msc.c: Check setsockopt() return value
Change-Id: I79a8fe9c025772e51560503504f517485b0ace34 Fixes: Coverity CID 57644
Diffstat (limited to 'openbsc/src/libbsc')
-rw-r--r--openbsc/src/libbsc/bsc_msc.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/openbsc/src/libbsc/bsc_msc.c b/openbsc/src/libbsc/bsc_msc.c
index 829ee2b..e373679 100644
--- a/openbsc/src/libbsc/bsc_msc.c
+++ b/openbsc/src/libbsc/bsc_msc.c
@@ -158,6 +158,9 @@ int bsc_msc_connect(struct bsc_msc_connection *con)
return -1;
}
+ /* TODO: Why are we not using the libosmocore soecket
+ * abstraction, or libosmo-netif? */
+
/* move to the next connection */
dest = (struct bsc_msc_dest *) con->dests->next;
llist_del(&dest->list);
@@ -197,7 +200,10 @@ int bsc_msc_connect(struct bsc_msc_connection *con)
sin.sin_port = htons(dest->port);
inet_aton(dest->ip, &sin.sin_addr);
- setsockopt(fd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
+ ret = setsockopt(fd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on));
+ if (ret != 0)
+ LOGP(DMSC, LOGL_ERROR,
+ "Failed to set SO_REUSEADDR socket option\n");
ret = connect(fd->fd, (struct sockaddr *) &sin, sizeof(sin));
if (ret == -1 && errno == EINPROGRESS) {