Add TCP_INET family to ip comparator

This commit is contained in:
Diadlo 2017-03-19 01:45:49 +03:00 committed by iphydf
parent f751fcfbf6
commit 6c9b95750c
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9

View File

@ -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];
}