Ensure that all queues passed to ifq_enqueue2() have a valid ifq_lock.

This commit is contained in:
thorpej 2022-08-27 19:15:00 +00:00
parent 703b581c96
commit 917e3f080a
1 changed files with 6 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: if_ppp.c,v 1.170 2022/08/27 19:04:43 thorpej Exp $ */
/* $NetBSD: if_ppp.c,v 1.171 2022/08/27 19:15:00 thorpej Exp $ */
/* Id: if_ppp.c,v 1.6 1997/03/04 03:33:00 paulus Exp */
/*
@ -102,7 +102,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: if_ppp.c,v 1.170 2022/08/27 19:04:43 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: if_ppp.c,v 1.171 2022/08/27 19:15:00 thorpej Exp $");
#ifdef _KERNEL_OPT
#include "ppp.h"
@ -323,6 +323,8 @@ ppp_create(const char *name, int unit)
IFQ_SET_MAXLEN(&sc->sc_fastq, IFQ_MAXLEN);
IFQ_SET_MAXLEN(&sc->sc_rawq, IFQ_MAXLEN);
IFQ_LOCK_INIT(&sc->sc_fastq);
/* Ratio of 1:2 packets between the regular and the fast queue */
sc->sc_maxfastq = 2;
IFQ_SET_READY(&sc->sc_if.if_snd);
@ -353,6 +355,8 @@ ppp_clone_destroy(struct ifnet *ifp)
bpf_detach(ifp);
if_detach(ifp);
IFQ_LOCK_DESTROY(&sc->sc_fastq);
free(sc, M_DEVBUF);
return 0;
}