diff options
author | Diadlo <polsha3@gmail.com> | 2017-03-19 01:45:49 +0300 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2017-04-13 20:25:19 +0000 |
commit | 6c9b95750cfb975a0b16db53cfefd9353e83d19b (patch) | |
tree | eea1dcf194a73052f4937139a5b71753fe5f27fa /toxcore/network.c | |
parent | f751fcfbf62316be1aee7842c6db1100cc7c04b2 (diff) |
Add TCP_INET family to ip comparator
Diffstat (limited to 'toxcore/network.c')
-rw-r--r-- | toxcore/network.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/toxcore/network.c b/toxcore/network.c index 55cfa338..f74363e6 100644 --- a/toxcore/network.c +++ b/toxcore/network.c | |||
@@ -822,7 +822,7 @@ int ip_equal(const IP *a, const IP *b) | |||
822 | 822 | ||
823 | /* same family */ | 823 | /* same family */ |
824 | if (a->family == b->family) { | 824 | if (a->family == b->family) { |
825 | if (a->family == AF_INET) { | 825 | if (a->family == AF_INET || a->family == TCP_INET) { |
826 | struct in_addr addr_a; | 826 | struct in_addr addr_a; |
827 | struct in_addr addr_b; | 827 | struct in_addr addr_b; |
828 | fill_addr4(a->ip4, &addr_a); | 828 | fill_addr4(a->ip4, &addr_a); |
@@ -830,7 +830,7 @@ int ip_equal(const IP *a, const IP *b) | |||
830 | return addr_a.s_addr == addr_b.s_addr; | 830 | return addr_a.s_addr == addr_b.s_addr; |
831 | } | 831 | } |
832 | 832 | ||
833 | if (a->family == AF_INET6) { | 833 | if (a->family == AF_INET6 || a->family == TCP_INET6) { |
834 | return a->ip6.uint64[0] == b->ip6.uint64[0] && | 834 | return a->ip6.uint64[0] == b->ip6.uint64[0] && |
835 | a->ip6.uint64[1] == b->ip6.uint64[1]; | 835 | a->ip6.uint64[1] == b->ip6.uint64[1]; |
836 | } | 836 | } |