Module Name: src
Committed By: thorpej
Date: Sat Aug 27 19:15:00 UTC 2022
Modified Files:
src/sys/net: if_ppp.c
Log Message:
Ensure that all queues passed to ifq_enqueue2() have a valid ifq_lock.
To generate a diff of this commit:
cvs rdiff -u -r1.170 -r1.171 src/sys/net/if_ppp.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/net/if_ppp.c
diff -u src/sys/net/if_ppp.c:1.170 src/sys/net/if_ppp.c:1.171
--- src/sys/net/if_ppp.c:1.170 Sat Aug 27 19:04:43 2022
+++ src/sys/net/if_ppp.c Sat Aug 27 19:15:00 2022
@@ -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;
}