Browse code

sipdump: use the right flag to parse ipv6

(cherry picked from commit 9a15781f4804ef6620fad5a09ff2e9aacae871cb)

Daniel-Constantin Mierla authored on 17/09/2022 08:18:39
Showing 1 changed files
... ...
@@ -198,8 +198,8 @@ void sipdump_write_pcap(FILE *fs, sipdump_data_t *spd)
198 198
 			return;
199 199
 		}
200 200
 		memcpy(&v_pcap_ipv6_header.ip6_src, &ip6addr, sizeof(struct in6_addr));
201
-		if (inet_pton(AF_INET, spd->dst_ip.s, &ip6addr) != 1) {
202
-			LM_ERR("failed to parse IPv4 address %s\n", spd->dst_ip.s);
201
+		if (inet_pton(AF_INET6, spd->dst_ip.s, &ip6addr) != 1) {
202
+			LM_ERR("failed to parse IPv6 address %s\n", spd->dst_ip.s);
203 203
 			return;
204 204
 		}
205 205
 		memcpy(&v_pcap_ipv6_header.ip6_dst, &ip6addr, sizeof(struct in6_addr));