Date: Sun, 19 Apr 2020 15:37:13 +0000 (UTC) From: Kristof Provost <kp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r360097 - head/sbin/pfctl Message-ID: <202004191537.03JFbDPa049133@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kp Date: Sun Apr 19 15:37:13 2020 New Revision: 360097 URL: https://svnweb.freebsd.org/changeset/base/360097 Log: 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 Modified: head/sbin/pfctl/pfctl_parser.c Modified: head/sbin/pfctl/pfctl_parser.c ============================================================================== --- head/sbin/pfctl/pfctl_parser.c Sun Apr 19 15:32:14 2020 (r360096) +++ head/sbin/pfctl/pfctl_parser.c Sun Apr 19 15:37:13 2020 (r360097) @@ -1436,14 +1436,15 @@ 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))
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202004191537.03JFbDPa049133>