ippair: check ip family when comparing

Ticket: 8559

Do not accept an IPv6 as an IPv4 (even if the hash is likely
different in the first place)

(cherry picked from commit 4a728464e6)
pull/15826/head
Philippe Antoine 2 months ago
parent 19880f9d5b
commit 9d788575c5

@ -453,8 +453,11 @@ static inline int IPPairCompare(IPPair *p, Address *a, Address *b)
{
/* compare in both directions */
if ((CMP_ADDR(&p->a[0], a) && CMP_ADDR(&p->a[1], b)) ||
(CMP_ADDR(&p->a[0], b) && CMP_ADDR(&p->a[1], a)))
return 1;
(CMP_ADDR(&p->a[0], b) && CMP_ADDR(&p->a[1], a))) {
if (p->a[0].family == a->family) {
return 1;
}
}
return 0;
}

Loading…
Cancel
Save