Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net Ensure that all queues passed to ifq_enqueue2() have...



details:   https://anonhg.NetBSD.org/src/rev/54bb897cfc53
branches:  trunk
changeset: 369669:54bb897cfc53
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Aug 27 19:15:00 2022 +0000

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

diffstat:

 sys/net/if_ppp.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (36 lines):

diff -r 486557e71920 -r 54bb897cfc53 sys/net/if_ppp.c
--- a/sys/net/if_ppp.c  Sat Aug 27 19:04:43 2022 +0000
+++ b/sys/net/if_ppp.c  Sat Aug 27 19:15:00 2022 +0000
@@ -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 @@
        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 @@
        bpf_detach(ifp);
        if_detach(ifp);
 
+       IFQ_LOCK_DESTROY(&sc->sc_fastq);
+
        free(sc, M_DEVBUF);
        return 0;
 }



Home | Main Index | Thread Index | Old Index