From 442f3ba311a4f01835953feb59ae1ea41c44fdf8 Mon Sep 17 00:00:00 2001 From: Hiroki Sato Date: Tue, 13 Dec 2016 20:55:46 +0000 Subject: [PATCH] Remove an extra "break" which could incorrectly terminate an STAILQ_FOREACH() loop when an AF_INET6 rule matched. Spotted by: cem --- usr.sbin/syslogd/syslogd.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index 53866382e3b4..a198b5f8e3b2 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -2465,7 +2465,6 @@ validate(struct sockaddr *sa, const char *hname) struct allowedpeer *ap; struct sockaddr_in *sin4, *a4p = NULL, *m4p = NULL; #ifdef INET6 - int reject; struct sockaddr_in6 *sin6, *a6p = NULL, *m6p = NULL; #endif struct addrinfo hints, *res; @@ -2533,13 +2532,8 @@ validate(struct sockaddr *sa, const char *hname) dprintf("rejected in rule %d due to scope mismatch.\n", i); continue; } - reject = 0; if (IN6_ARE_MASKED_ADDR_EQUAL(&sin6->sin6_addr, &a6p->sin6_addr, &m6p->sin6_addr) != 0) { - ++reject; - break; - } - if (reject) { dprintf("rejected in rule %d due to IP mismatch.\n", i); continue; }