mirror of https://github.com/PentHertz/srsLTE.git
Make sure that bind returns error if it cannot bind. Added test for SCTP bind error/success.
This commit is contained in:
parent
e721504f8e
commit
0b948d4098
|
@ -195,6 +195,8 @@ bool bind_addr(int fd, const sockaddr_in& addr_in)
|
||||||
perror("bind()");
|
perror("bind()");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
srslog::fetch_basic_logger(LOGSERVICE)
|
||||||
|
.debug("Successfully bound to address %s:%d", get_ip(addr_in).c_str(), get_port(addr_in));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -206,7 +208,11 @@ bool bind_addr(int fd, const char* bind_addr_str, int port, sockaddr_in* addr_re
|
||||||
.error("Failed to convert IP address (%s) to sockaddr_in struct", bind_addr_str);
|
.error("Failed to convert IP address (%s) to sockaddr_in struct", bind_addr_str);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
bind_addr(fd, addr_tmp);
|
|
||||||
|
if (not bind_addr(fd, addr_tmp)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (addr_result != nullptr) {
|
if (addr_result != nullptr) {
|
||||||
*addr_result = addr_tmp;
|
*addr_result = addr_tmp;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue