mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Add TCP_INET family to ip comparator
This commit is contained in:
parent
f751fcfbf6
commit
6c9b95750c
|
@ -822,7 +822,7 @@ int ip_equal(const IP *a, const IP *b)
|
|||
|
||||
/* same family */
|
||||
if (a->family == b->family) {
|
||||
if (a->family == AF_INET) {
|
||||
if (a->family == AF_INET || a->family == TCP_INET) {
|
||||
struct in_addr addr_a;
|
||||
struct in_addr addr_b;
|
||||
fill_addr4(a->ip4, &addr_a);
|
||||
|
@ -830,7 +830,7 @@ int ip_equal(const IP *a, const IP *b)
|
|||
return addr_a.s_addr == addr_b.s_addr;
|
||||
}
|
||||
|
||||
if (a->family == AF_INET6) {
|
||||
if (a->family == AF_INET6 || a->family == TCP_INET6) {
|
||||
return a->ip6.uint64[0] == b->ip6.uint64[0] &&
|
||||
a->ip6.uint64[1] == b->ip6.uint64[1];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user