Browse code

siptrace: fixed IPv6 without brackets

more details GH #2775

(cherry picked from commit 417eb2a7052a9354712663cca9e3bc075a3f69c0)
(cherry picked from commit 903e41468a00edeff52cbf1e3c0053c82860c92c)

Sergey Safarov authored on 10/06/2021 09:17:54 • Daniel-Constantin Mierla committed on 29/07/2021 08:46:07
Showing 1 changed files
... ...
@@ -2061,7 +2061,7 @@ int siptrace_net_data_recv(sr_event_param_t *evp)
2061 2061
 
2062 2062
 	sto.fromip.len = snprintf(sto.fromip_buff, SIPTRACE_ADDR_MAX, "%s:%s:%d",
2063 2063
 			siptrace_proto_name(nd->rcv->proto),
2064
-			ip_addr2a(&nd->rcv->src_ip), (int)nd->rcv->src_port);
2064
+			ip_addr2strz(&nd->rcv->src_ip), (int)nd->rcv->src_port);
2065 2065
 	if(sto.fromip.len<0 || sto.fromip.len>=SIPTRACE_ADDR_MAX) {
2066 2066
 		LM_ERR("failed to format toip buffer (%d)\n", sto.fromip.len);
2067 2067
 		sto.fromip.s = SIPTRACE_ANYADDR;
... ...
@@ -2071,7 +2071,7 @@ int siptrace_net_data_recv(sr_event_param_t *evp)
2071 2071
 	}
2072 2072
 
2073 2073
 	sto.toip.len = snprintf(sto.toip_buff, SIPTRACE_ADDR_MAX, "%s:%s:%d",
2074
-			siptrace_proto_name(nd->rcv->proto), ip_addr2a(&nd->rcv->dst_ip),
2074
+			siptrace_proto_name(nd->rcv->proto), ip_addr2strz(&nd->rcv->dst_ip),
2075 2075
 			(int)nd->rcv->dst_port);
2076 2076
 	if(sto.toip.len<0 || sto.toip.len>=SIPTRACE_ADDR_MAX) {
2077 2077
 		LM_ERR("failed to format toip buffer (%d)\n", sto.toip.len);