osmux: Log osmux socket during osmux_init

Change-Id: I43a658b19765b1c3b3cc42f78602b793ee36c67d
This commit is contained in:
Pau Espin Pedrol
2019-05-06 13:57:31 +02:00
committed by Harald Welte
parent ac772d8b0c
commit f027f17dcb

View File

@@ -15,6 +15,7 @@
#include <inttypes.h> /* for PRIu64 */
#include <netinet/in.h>
#include <osmocom/core/msgb.h>
#include <osmocom/core/socket.h>
#include <osmocom/core/talloc.h>
#include <osmocom/netif/osmux.h>
@@ -517,7 +518,8 @@ int osmux_init(int role, struct mgcp_config *cfg)
ret = mgcp_create_bind(cfg->osmux_addr, &osmux_fd, cfg->osmux_port);
if (ret < 0) {
LOGP(DLMGCP, LOGL_ERROR, "cannot bind OSMUX socket\n");
LOGP(DLMGCP, LOGL_ERROR, "cannot bind OSMUX socket to %s:%u\n",
cfg->osmux_addr, cfg->osmux_port);
return ret;
}
mgcp_set_ip_tos(osmux_fd.fd, cfg->endp_dscp);
@@ -525,11 +527,15 @@ int osmux_init(int role, struct mgcp_config *cfg)
ret = osmo_fd_register(&osmux_fd);
if (ret < 0) {
LOGP(DLMGCP, LOGL_ERROR, "cannot register OSMUX socket\n");
LOGP(DLMGCP, LOGL_ERROR, "cannot register OSMUX socket %s\n",
osmo_sock_get_name2(osmux_fd.fd));
return ret;
}
cfg->osmux_init = 1;
LOGP(DLMGCP, LOGL_INFO, "OSMUX socket listening on %s\n",
osmo_sock_get_name2(osmux_fd.fd));
return 0;
}