summaryrefslogtreecommitdiff
path: root/sbin/pfctl
diff options
context:
space:
mode:
authorKristof Provost <kp@FreeBSD.org>2020-04-19 15:37:13 +0000
committerKristof Provost <kp@FreeBSD.org>2020-04-19 15:37:13 +0000
commit8fd675d8a0538544a85483f7a9bed2bd48382926 (patch)
tree2173ea4d60cb1d4548d2a8761eeca29da98dcea0 /sbin/pfctl
parent681652667af16267b350fc8dd31b93e7c8133611 (diff)
downloadsrc-test-8fd675d8a0538544a85483f7a9bed2bd48382926.tar.gz
src-test-8fd675d8a0538544a85483f7a9bed2bd48382926.zip
pfctl: Call ifa_load() before ifa_grouplookup()
ifa_grouplookup() uses the data loaded in ifa_load() (through is_a_group()), so we must call ifa_load() before we can rely on any of the data it populates. Submitted by: Nick Rogers MFC after: 1 week Sponsored by: RG Nets
Notes
Notes: svn path=/head/; revision=360097
Diffstat (limited to 'sbin/pfctl')
-rw-r--r--sbin/pfctl/pfctl_parser.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sbin/pfctl/pfctl_parser.c b/sbin/pfctl/pfctl_parser.c
index 94f515af73f15..47a3992da128d 100644
--- a/sbin/pfctl/pfctl_parser.c
+++ b/sbin/pfctl/pfctl_parser.c
@@ -1436,15 +1436,16 @@ ifa_lookup(char *ifa_name, int flags)
int got4 = 0, got6 = 0;
const char *last_if = NULL;
+ /* first load iftab and isgroup_map */
+ if (iftab == NULL)
+ ifa_load();
+
if ((h = ifa_grouplookup(ifa_name, flags)) != NULL)
return (h);
if (!strncmp(ifa_name, "self", IFNAMSIZ))
ifa_name = NULL;
- if (iftab == NULL)
- ifa_load();
-
for (p = iftab; p; p = p->next) {
if (ifa_skip_if(ifa_name, p))
continue;