From 5b83099964d657512231b9bbd3e59a507d271a1e Mon Sep 17 00:00:00 2001 From: Peter Schwindt Date: Mon, 10 Nov 2014 17:00:35 +0100 Subject: [PATCH] Update ejabberd_c2s_types' ipv4/v6 switch Somethings v4 addresses don't start with ::FFFF: ;-) --- ejabberd_c2s_types | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ejabberd_c2s_types b/ejabberd_c2s_types index 32ce8b0..8df11c4 100755 --- a/ejabberd_c2s_types +++ b/ejabberd_c2s_types @@ -5,6 +5,7 @@ import subprocess import sys +import ipaddr if 'autoconf' in sys.argv: print('yes') @@ -57,7 +58,8 @@ for line in stdout: if 'compressed' in conn: compressed += 1 - if ip.startswith('::FFFF:'): + addrx = ipaddr.IPAddress(ip) + if addrx.version == 4: ipv4 += 1 else: ipv6 += 1