[sr-dev] git:5.5:903e4146: siptrace: fixed IPv6 without brackets

Daniel-Constantin Mierla miconda at gmail.com
Thu Jun 10 12:30:36 CEST 2021


Module: kamailio
Branch: 5.5
Commit: 903e41468a00edeff52cbf1e3c0053c82860c92c
URL: https://github.com/kamailio/kamailio/commit/903e41468a00edeff52cbf1e3c0053c82860c92c

Author: Sergey Safarov <s.safarov at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2021-06-10T12:29:32+02:00

siptrace: fixed IPv6 without brackets

more details GH #2775

(cherry picked from commit 417eb2a7052a9354712663cca9e3bc075a3f69c0)

---

Modified: src/modules/siptrace/siptrace.c

---

Diff:  https://github.com/kamailio/kamailio/commit/903e41468a00edeff52cbf1e3c0053c82860c92c.diff
Patch: https://github.com/kamailio/kamailio/commit/903e41468a00edeff52cbf1e3c0053c82860c92c.patch

---

diff --git a/src/modules/siptrace/siptrace.c b/src/modules/siptrace/siptrace.c
index 012644bfa0..102502105d 100644
--- a/src/modules/siptrace/siptrace.c
+++ b/src/modules/siptrace/siptrace.c
@@ -2117,7 +2117,7 @@ int siptrace_net_data_recv(sr_event_param_t *evp)
 
 	sto.fromip.len = snprintf(sto.fromip_buff, SIPTRACE_ADDR_MAX, "%s:%s:%d",
 			siptrace_proto_name(nd->rcv->proto),
-			ip_addr2a(&nd->rcv->src_ip), (int)nd->rcv->src_port);
+			ip_addr2strz(&nd->rcv->src_ip), (int)nd->rcv->src_port);
 	if(sto.fromip.len<0 || sto.fromip.len>=SIPTRACE_ADDR_MAX) {
 		LM_ERR("failed to format toip buffer (%d)\n", sto.fromip.len);
 		sto.fromip.s = SIPTRACE_ANYADDR;
@@ -2127,7 +2127,7 @@ int siptrace_net_data_recv(sr_event_param_t *evp)
 	}
 
 	sto.toip.len = snprintf(sto.toip_buff, SIPTRACE_ADDR_MAX, "%s:%s:%d",
-			siptrace_proto_name(nd->rcv->proto), ip_addr2a(&nd->rcv->dst_ip),
+			siptrace_proto_name(nd->rcv->proto), ip_addr2strz(&nd->rcv->dst_ip),
 			(int)nd->rcv->dst_port);
 	if(sto.toip.len<0 || sto.toip.len>=SIPTRACE_ADDR_MAX) {
 		LM_ERR("failed to format toip buffer (%d)\n", sto.toip.len);




More information about the sr-dev mailing list