Module: kamailio
Branch: master
Commit: 621f3132708405939d3a40fb98ae57b793cd246e
URL:
https://github.com/kamailio/kamailio/commit/621f3132708405939d3a40fb98ae57b…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2024-09-25T10:07:44+02:00
core: print errno on tcp bind failure
- log message with value of sr_bind_ipv6_link_local
---
Modified: src/core/tcp_main.c
---
Diff:
https://github.com/kamailio/kamailio/commit/621f3132708405939d3a40fb98ae57b…
Patch:
https://github.com/kamailio/kamailio/commit/621f3132708405939d3a40fb98ae57b…
---
diff --git a/src/core/tcp_main.c b/src/core/tcp_main.c
index 9daaf1ce641..e65520fa7ed 100644
--- a/src/core/tcp_main.c
+++ b/src/core/tcp_main.c
@@ -3284,12 +3284,14 @@ int tcp_init(struct socket_info *sock_info)
}
#endif
if(bind(sock_info->socket, &addr->s, sockaddru_len(*addr)) == -1) {
- LM_ERR("bind(%x, %p, %d) on %s:%d : %s\n", sock_info->socket,
&addr->s,
- (unsigned)sockaddru_len(*addr), sock_info->address_str.s,
- sock_info->port_no, strerror(errno));
+ LM_ERR("bind(%x, %p, %d) on [%s]:%d : (%d / %s)\n", sock_info->socket,
+ &addr->s, (unsigned)sockaddru_len(*addr),
+ sock_info->address_str.s, sock_info->port_no, errno,
+ strerror(errno));
if(addr->s.sa_family == AF_INET6) {
LM_ERR("might be caused by using a link local address, is "
- "'bind_ipv6_link_local' set?\n");
+ "'bind_ipv6_link_local' set (now: %d)?\n",
+ sr_bind_ipv6_link_local);
}
goto error;
}