[sr-dev] git:5.5:1a3a12b0: sipdump: use the right flag to parse ipv6

Daniel-Constantin Mierla miconda at gmail.com
Sat Sep 17 10:26:13 CEST 2022


Module: kamailio
Branch: 5.5
Commit: 1a3a12b07d6bbb624f47350c8e92084dafdc89f6
URL: https://github.com/kamailio/kamailio/commit/1a3a12b07d6bbb624f47350c8e92084dafdc89f6

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2022-09-17T10:24:26+02:00

sipdump: use the right flag to parse ipv6

(cherry picked from commit 9a15781f4804ef6620fad5a09ff2e9aacae871cb)
(cherry picked from commit ebda78c92c21770af1a32afc2930740b80d73fd3)

---

Modified: src/modules/sipdump/sipdump_pcap.c

---

Diff:  https://github.com/kamailio/kamailio/commit/1a3a12b07d6bbb624f47350c8e92084dafdc89f6.diff
Patch: https://github.com/kamailio/kamailio/commit/1a3a12b07d6bbb624f47350c8e92084dafdc89f6.patch

---

diff --git a/src/modules/sipdump/sipdump_pcap.c b/src/modules/sipdump/sipdump_pcap.c
index e808ff23fe..0db2697790 100644
--- a/src/modules/sipdump/sipdump_pcap.c
+++ b/src/modules/sipdump/sipdump_pcap.c
@@ -198,8 +198,8 @@ void sipdump_write_pcap(FILE *fs, sipdump_data_t *spd)
 			return;
 		}
 		memcpy(&v_pcap_ipv6_header.ip6_src, &ip6addr, sizeof(struct in6_addr));
-		if (inet_pton(AF_INET, spd->dst_ip.s, &ip6addr) != 1) {
-			LM_ERR("failed to parse IPv4 address %s\n", spd->dst_ip.s);
+		if (inet_pton(AF_INET6, spd->dst_ip.s, &ip6addr) != 1) {
+			LM_ERR("failed to parse IPv6 address %s\n", spd->dst_ip.s);
 			return;
 		}
 		memcpy(&v_pcap_ipv6_header.ip6_dst, &ip6addr, sizeof(struct in6_addr));




More information about the sr-dev mailing list