diff options
author | Pau Espin Pedrol <pespin@sysmocom.de> | 2018-04-05 17:00:22 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2018-04-05 19:57:35 +0000 |
commit | 5d50fa50b3f61c2ea6632cd25918440835d4a672 (patch) | |
tree | ca452cf94c4fd6c95f59302bb19f81449ad14e75 /tests/socket/socket_test.ok | |
parent | a8b6cc4cd90ef0649aada4469f91c4e58819f1a2 (diff) |
socket.c: osmo_sock_init2: bind: Several logic fixes and log improvements
After investigating osmo-msc showing this log message and looking at the
code, it's a bit difficult to find out what's going on in the code:
socket.c:224 unable to bind socket: (null):0: Protocol not supported
The root cause was not yet found, but probably SCTP is not enabled in
the kernel of the host running it.
The cod eis most probably failing during socket() and not due to bind
error as the log says, so let's print an error if socket() fails.
Then, if setsockopt fails, we want to still keep trying in case an extra
addr was offered by addrinfo_helper. It is definetly wrong to continue
if setsockopt fails, because then we are skipping the bind(), which is a
fundamental part of what osmo_sock_init2 does.
Then, let's print the bind error when it really happens, and re-write
the extra log at the end if we reach the point at which no suitable addr
is found.
Change-Id: I1854422ad92dadf33ed4d849e15c0380c3bf1626
Diffstat (limited to 'tests/socket/socket_test.ok')
0 files changed, 0 insertions, 0 deletions