pfctl: Fix crash on ALTQ configuration

The following config could crash pfctl:
	altq on igb0 fairq bandwidth 1Gb queue { qLink }
	queue qLink fairq(default)

That happens because when we're parsing the parent queue (on igb0) it
doesn't have a parent, and the check in eval_pfqueue_fairq() checks
pa->parent rather than parent.

This was changed in eval_pfqueue_hfsc() in
1d34c9dac8, but not for fairq.

Reviewed by:	pkelsey
MFC after:	1 week
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D30346
This commit is contained in:
Kristof Provost 2021-05-18 15:03:01 +02:00
parent 7bd7933f9a
commit 26705a39e5

View File

@ -864,7 +864,7 @@ eval_pfqueue_fairq(struct pfctl *pf __unused, struct pf_altq *pa,
opts = &pa->pq_u.fairq_opts; opts = &pa->pq_u.fairq_opts;
if (pa->parent == NULL) { if (parent == NULL) {
/* root queue */ /* root queue */
opts->lssc_m1 = pa->ifbandwidth; opts->lssc_m1 = pa->ifbandwidth;
opts->lssc_m2 = pa->ifbandwidth; opts->lssc_m2 = pa->ifbandwidth;