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
This commit is contained in:
Neels Hofmeyr
2018-12-12 01:16:42 +01:00
committed by Neels Hofmeyr
parent 32d15cc8ba
commit ad21a0e166

View File

@@ -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;
}