From ee1cc34d551f978c63402e7ad6a33e410636a277 Mon Sep 17 00:00:00 2001 From: "Coren[m]" Date: Sun, 15 Sep 2013 23:39:09 +0200 Subject: Fix in ip_equal, plus testing code which led to that fix... network.c: - use the correct macro for IPv4-in-IPv6 test network_test.c: - bunch of tests for addr_resolve() and ip_equal() --- toxcore/network.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'toxcore') diff --git a/toxcore/network.c b/toxcore/network.c index fe2ef238..4b6dc3be 100644 --- a/toxcore/network.c +++ b/toxcore/network.c @@ -518,10 +518,10 @@ int ip_equal(IP *a, IP *b) /* different family: check on the IPv6 one if it is the IPv4 one embedded */ if ((a->family == AF_INET) && (b->family == AF_INET6)) { - if (IN6_IS_ADDR_V4COMPAT(&b->ip6.in6_addr)) + if (IN6_IS_ADDR_V4MAPPED(&b->ip6.in6_addr)) return (a->ip4.in_addr.s_addr == b->ip6.uint32[3]); } else if ((a->family == AF_INET6) && (b->family == AF_INET)) { - if (IN6_IS_ADDR_V4COMPAT(&a->ip6.in6_addr)) + if (IN6_IS_ADDR_V4MAPPED(&a->ip6.in6_addr)) return (a->ip6.uint32[3] == b->ip4.in_addr.s_addr); } -- cgit v1.2.3