If a table has mixed IPv4 and IPv6 addresses and we walk over it an IPv6
address could be returned if it followed an IPv4 address, causing an
error.
Found by florian@
OK florian@ millert@
-/* $OpenBSD: pf.c,v 1.11 2019/06/28 13:32:51 deraadt Exp $ */
+/* $OpenBSD: pf.c,v 1.12 2022/01/30 13:26:14 martijn Exp $ */
/*
* Copyright (c) 2012 Joel Knight <joel@openbsd.org>
goto fail;
PFRB_FOREACH(as, &ba) {
- if (found)
- goto found;
if (as->pfras_a.pfra_af != AF_INET)
continue;
+ if (found)
+ goto found;
if ((memcmp(&as->pfras_a.pfra_ip4addr,
&ras->pfras_a.pfra_ip4addr,
sizeof(as->pfras_a.pfra_ip4addr)) == 0)