From d9cb06bec04c5dbff21dfb54a16b80a6be2e1b08 Mon Sep 17 00:00:00 2001 From: philip Date: Sun, 1 Jun 2008 14:09:54 +0000 Subject: [PATCH] Use INSERT_OBJECT_INT_LINK_INDEX macro instead of TAILQ_INSERT_TAIL when filling the table of ALTQ queues retrieved from the kernel. It is possible for the kernel to return the queues not by pa.altq.qid order. When this happens, pf_snmp would only partially fill its table. PR: bin/120974 Submitted by: Mykola Dzham MFC after: 3 days --- usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c b/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c index e12e28387ad9..919e5d48cbd1 100644 --- a/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c +++ b/usr.sbin/bsnmpd/modules/snmp_pf/pf_snmp.c @@ -1025,7 +1025,7 @@ pfq_refresh(void) memcpy(&e->altq, &pa.altq, sizeof(struct pf_altq)); e->index = pa.altq.qid; pfq_table_count = i; - TAILQ_INSERT_TAIL(&pfq_table, e, link); + INSERT_OBJECT_INT_LINK_INDEX(e, &pfq_table, link, index); } }