From ad21a0e166209635650ee142d4643ae9aa198c9f Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Wed, 12 Dec 2018 01:16:42 +0100 Subject: [PATCH] check_rtp: on IP:port errors, log the IP and port Half of those are obviously zero, but I'd rather print the raw data instead of adding string constants, even if the condition must always lead to 0.0.0.0:0. Rationale: I had osmo-mgw listen on 0.0.0.0 and got the error message DRTP ERROR endpoint:0x1 destination IP-address is invalid which didn't convey that 0.0.0.0 is regarded as invalid. Change-Id: I9e98d464a27038904797c5c10735a98ef5b7b9c3 --- src/libosmo-mgcp/mgcp_network.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index de34cc627..7af8e71f2 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -945,22 +945,22 @@ static int check_rtp_destin(struct mgcp_conn_rtp *conn) * and IP-address for outgoing data. */ if (strcmp(inet_ntoa(conn->end.addr), "0.0.0.0") == 0 && conn->end.rtp_port == 0) { LOGP(DRTP, LOGL_DEBUG, - "endpoint:0x%x destination IP-address and rtp port is (not yet) known\n", - ENDPOINT_NUMBER(endp)); + "endpoint:0x%x destination IP-address and rtp port is (not yet) known (%s:%u)\n", + ENDPOINT_NUMBER(endp), inet_ntoa(conn->end.addr), conn->end.rtp_port); return -1; } if (strcmp(inet_ntoa(conn->end.addr), "0.0.0.0") == 0) { LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x destination IP-address is invalid\n", - ENDPOINT_NUMBER(endp)); + "endpoint:0x%x destination IP-address is invalid (%s:%u)\n", + ENDPOINT_NUMBER(endp), inet_ntoa(conn->end.addr), conn->end.rtp_port); return -1; } if (conn->end.rtp_port == 0) { LOGP(DRTP, LOGL_ERROR, - "endpoint:0x%x destination rtp port is invalid\n", - ENDPOINT_NUMBER(endp)); + "endpoint:0x%x destination rtp port is invalid (%s:%u)\n", + ENDPOINT_NUMBER(endp), inet_ntoa(conn->end.addr), conn->end.rtp_port); return -1; }