Browse code

siptrace: fixed IPv6 without brackets

more details GH #2775

(cherry picked from commit 417eb2a7052a9354712663cca9e3bc075a3f69c0)

Sergey Safarov authored on 10/06/2021 09:17:54 • Daniel-Constantin Mierla committed on 10/06/2021 10:29:32
Showing 1 changed files
... ...
@@ -2117,7 +2117,7 @@ int siptrace_net_data_recv(sr_event_param_t *evp)
2117 2117
 
2118 2118
 	sto.fromip.len = snprintf(sto.fromip_buff, SIPTRACE_ADDR_MAX, "%s:%s:%d",
2119 2119
 			siptrace_proto_name(nd->rcv->proto),
2120
-			ip_addr2a(&nd->rcv->src_ip), (int)nd->rcv->src_port);
2120
+			ip_addr2strz(&nd->rcv->src_ip), (int)nd->rcv->src_port);
2121 2121
 	if(sto.fromip.len<0 || sto.fromip.len>=SIPTRACE_ADDR_MAX) {
2122 2122
 		LM_ERR("failed to format toip buffer (%d)\n", sto.fromip.len);
2123 2123
 		sto.fromip.s = SIPTRACE_ANYADDR;
... ...
@@ -2127,7 +2127,7 @@ int siptrace_net_data_recv(sr_event_param_t *evp)
2127 2127
 	}
2128 2128
 
2129 2129
 	sto.toip.len = snprintf(sto.toip_buff, SIPTRACE_ADDR_MAX, "%s:%s:%d",
2130
-			siptrace_proto_name(nd->rcv->proto), ip_addr2a(&nd->rcv->dst_ip),
2130
+			siptrace_proto_name(nd->rcv->proto), ip_addr2strz(&nd->rcv->dst_ip),
2131 2131
 			(int)nd->rcv->dst_port);
2132 2132
 	if(sto.toip.len<0 || sto.toip.len>=SIPTRACE_ADDR_MAX) {
2133 2133
 		LM_ERR("failed to format toip buffer (%d)\n", sto.toip.len);