Browse code

siptrace: fixed IPv6 without brackets

more details GH #2775

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

Sergey Safarov authored on 10/06/2021 09:17:54 • Henning Westerholt committed on 22/10/2021 12:01:35
Showing 1 changed files
... ...
@@ -1994,7 +1994,7 @@ int siptrace_net_data_recv(sr_event_param_t *evp)
1994 1994
 
1995 1995
 	sto.fromip.len = snprintf(sto.fromip_buff, SIPTRACE_ADDR_MAX, "%s:%s:%d",
1996 1996
 			siptrace_proto_name(nd->rcv->proto),
1997
-			ip_addr2a(&nd->rcv->src_ip), (int)nd->rcv->src_port);
1997
+			ip_addr2strz(&nd->rcv->src_ip), (int)nd->rcv->src_port);
1998 1998
 	if(sto.fromip.len<0 || sto.fromip.len>=SIPTRACE_ADDR_MAX) {
1999 1999
 		LM_ERR("failed to format toip buffer (%d)\n", sto.fromip.len);
2000 2000
 		sto.fromip.s = SIPTRACE_ANYADDR;
... ...
@@ -2004,7 +2004,7 @@ int siptrace_net_data_recv(sr_event_param_t *evp)
2004 2004
 	}
2005 2005
 
2006 2006
 	sto.toip.len = snprintf(sto.toip_buff, SIPTRACE_ADDR_MAX, "%s:%s:%d",
2007
-			siptrace_proto_name(nd->rcv->proto), ip_addr2a(&nd->rcv->dst_ip),
2007
+			siptrace_proto_name(nd->rcv->proto), ip_addr2strz(&nd->rcv->dst_ip),
2008 2008
 			(int)nd->rcv->dst_port);
2009 2009
 	if(sto.toip.len<0 || sto.toip.len>=SIPTRACE_ADDR_MAX) {
2010 2010
 		LM_ERR("failed to format toip buffer (%d)\n", sto.toip.len);