From 8667d5169df8d06e10ee3f3104e4cd533d15ac57 Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Fri, 28 Aug 2020 19:37:08 +0200 Subject: [PATCH] mgcp_client: Use INET6_ADDRSTRLEN to store addresses in str format Warning: This breaks libosmo-mgcp-cli ABI! Related: SYS#4915 Change-Id: Ib778e9a72764103b52a462ea3c7fb56b23c1bcd6 --- TODO-RELEASE | 1 + include/osmocom/mgcp_client/mgcp_client.h | 2 +- include/osmocom/mgcp_client/mgcp_client_fsm.h | 2 +- src/libosmo-mgcp-client/mgcp_client.c | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/TODO-RELEASE b/TODO-RELEASE index e44305bad..8c7cd96a8 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -25,3 +25,4 @@ # #library what description / commit summary line osmo-mgw update osmo-gsm-manuals dependency to > 0.3.0 for vty_cpu_sched.adoc include +libosmo-mgcp-client mgcp_response, mgcp_conn_peer struct size change, breaks ABI diff --git a/include/osmocom/mgcp_client/mgcp_client.h b/include/osmocom/mgcp_client/mgcp_client.h index d4dd2d973..8914cc220 100644 --- a/include/osmocom/mgcp_client/mgcp_client.h +++ b/include/osmocom/mgcp_client/mgcp_client.h @@ -75,7 +75,7 @@ struct mgcp_response { char *body; struct mgcp_response_head head; uint16_t audio_port; - char audio_ip[INET_ADDRSTRLEN]; + char audio_ip[INET6_ADDRSTRLEN]; unsigned int ptime; enum mgcp_codecs codecs[MGCP_MAX_CODECS]; unsigned int codecs_len; diff --git a/include/osmocom/mgcp_client/mgcp_client_fsm.h b/include/osmocom/mgcp_client/mgcp_client_fsm.h index a1ebbb69f..e31575317 100644 --- a/include/osmocom/mgcp_client/mgcp_client_fsm.h +++ b/include/osmocom/mgcp_client/mgcp_client_fsm.h @@ -15,7 +15,7 @@ * sure it is correct. */ struct mgcp_conn_peer { /*! RTP connection IP-Address (optional, string e.g. "127.0.0.1") */ - char addr[INET_ADDRSTRLEN]; + char addr[INET6_ADDRSTRLEN]; /*! RTP connection IP-Port (optional) */ uint16_t port; diff --git a/src/libosmo-mgcp-client/mgcp_client.c b/src/libosmo-mgcp-client/mgcp_client.c index b1909f0bd..146a59d59 100644 --- a/src/libosmo-mgcp-client/mgcp_client.c +++ b/src/libosmo-mgcp-client/mgcp_client.c @@ -1121,7 +1121,7 @@ static int add_sdp(struct msgb *msg, struct mgcp_msg *mgcp_msg, struct mgcp_clie { unsigned int i; int rc = 0; - char local_ip[INET_ADDRSTRLEN]; + char local_ip[INET6_ADDRSTRLEN]; const char *codec; unsigned int pt;