Skip to content

Commit 9d78857

Browse files
committed
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 4a72846)
1 parent 19880f9 commit 9d78857

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

src/ippair.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,8 +453,11 @@ static inline int IPPairCompare(IPPair *p, Address *a, Address *b)
453453
{
454454
/* compare in both directions */
455455
if ((CMP_ADDR(&p->a[0], a) && CMP_ADDR(&p->a[1], b)) ||
456-
(CMP_ADDR(&p->a[0], b) && CMP_ADDR(&p->a[1], a)))
457-
return 1;
456+
(CMP_ADDR(&p->a[0], b) && CMP_ADDR(&p->a[1], a))) {
457+
if (p->a[0].family == a->family) {
458+
return 1;
459+
}
460+
}
458461
return 0;
459462
}
460463

0 commit comments

Comments
 (0)