aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-03-29 17:12:07 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-03-29 17:50:49 +0200
commitd000c27d3b64fe2201c13ad2c7edc31bff5d5619 (patch)
tree741c53a11cfaae5279549a265c217277fc92a942
parent06f4fc79a221b2451bdbf9e1035d42f3bf9eaf1c (diff)
nat: Improve the error message for the failing bind call
Print the IP and port that was used for the address to bind to.
-rw-r--r--openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c
index e3b57d931..95a5388ff 100644
--- a/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c
+++ b/openbsc/src/osmo-bsc_nat/bsc_mgcp_utils.c
@@ -681,7 +681,8 @@ int bsc_mgcp_nat_init(struct bsc_nat *nat)
inet_aton(cfg->source_addr, &addr.sin_addr);
if (bind(cfg->gw_fd.bfd.fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
- LOGP(DMGCP, LOGL_ERROR, "Failed to bind. errno: %d\n", errno);
+ LOGP(DMGCP, LOGL_ERROR, "Failed to bind on %s:%d errno: %d\n",
+ cfg->source_addr, cfg->source_port, errno);
close(cfg->gw_fd.bfd.fd);
cfg->gw_fd.bfd.fd = -1;
return -1;