Module: kamailio
Branch: master
Commit: ac711cffea91c44f4e13b5d75d6ae01ee4599099
URL:
https://github.com/kamailio/kamailio/commit/ac711cffea91c44f4e13b5d75d6ae01…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2022-09-16T13:54:56+02:00
sipdump: make ipv6 addresses without square brackets
---
Modified: src/modules/sipdump/sipdump_mod.c
---
Diff:
https://github.com/kamailio/kamailio/commit/ac711cffea91c44f4e13b5d75d6ae01…
Patch:
https://github.com/kamailio/kamailio/commit/ac711cffea91c44f4e13b5d75d6ae01…
---
diff --git a/src/modules/sipdump/sipdump_mod.c b/src/modules/sipdump/sipdump_mod.c
index 77c7c8606f6..4b2d87c260b 100644
--- a/src/modules/sipdump/sipdump_mod.c
+++ b/src/modules/sipdump/sipdump_mod.c
@@ -226,8 +226,9 @@ int ki_sipdump_send(sip_msg_t *msg, str *stag)
isd.tag = *stag;
isd.protoid = msg->rcv.proto;
isd.afid = msg->rcv.src_ip.af;
- isd.src_ip.len = ip_addr2sbufz(&msg->rcv.src_ip, srcip_buf,
+ isd.src_ip.len = ip_addr2sbuf(&msg->rcv.src_ip, srcip_buf,
IP_ADDR_MAX_STRZ_SIZE);
+ srcip_buf[isd.src_ip.len] = 0;
isd.src_ip.s = srcip_buf;
isd.src_port = msg->rcv.src_port;
if(msg->rcv.bind_address==NULL
@@ -340,8 +341,9 @@ int sipdump_msg_received(sr_event_param_t *evp)
isd.protoid = evp->rcv->proto;
isd.afid = (evp->rcv->bind_address!=NULL
&& evp->rcv->bind_address->address.af==AF_INET6)?AF_INET6:AF_INET;
- isd.src_ip.len = ip_addr2sbufz(&evp->rcv->src_ip, srcip_buf,
+ isd.src_ip.len = ip_addr2sbuf(&evp->rcv->src_ip, srcip_buf,
IP_ADDR_MAX_STRZ_SIZE);
+ srcip_buf[isd.src_ip.len] = '\0';
isd.src_ip.s = srcip_buf;
isd.src_port = evp->rcv->src_port;
if(evp->rcv->bind_address==NULL