Source-Changes-HG archive

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

[src/trunk]: src/sys/net Fix error with ifq not being set before use. Explic...



details:   https://anonhg.NetBSD.org/src/rev/7f401b794d0f
branches:  trunk
changeset: 579919:7f401b794d0f
user:      explorer <explorer%NetBSD.org@localhost>
date:      Thu Mar 31 17:07:39 2005 +0000

description:
Fix error with ifq not being set before use.  Explicitly set it to NULL just before it may be set to the fastq, since if this becomes a loop (and in one case already is) this will always work.  
ifq_enqueue2() is designed to handle this case.

diffstat:

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

diffs (34 lines):

diff -r 5232fabbeb30 -r 7f401b794d0f sys/net/if_ppp.c
--- a/sys/net/if_ppp.c  Thu Mar 31 16:46:13 2005 +0000
+++ b/sys/net/if_ppp.c  Thu Mar 31 17:07:39 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ppp.c,v 1.97 2005/03/31 15:48:13 christos Exp $     */
+/*     $NetBSD: if_ppp.c,v 1.98 2005/03/31 17:07:39 explorer 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.97 2005/03/31 15:48:13 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ppp.c,v 1.98 2005/03/31 17:07:39 explorer Exp $");
 
 #include "ppp.h"
 
@@ -1024,6 +1024,7 @@
        m0->m_nextpkt = NULL;
        sc->sc_npqtail = &m0->m_nextpkt;
     } else {
+       ifq = NULL;
        if (m0->m_flags & M_HIGHPRI)
                ifq = &sc->sc_fastq;
        if ((error = ifq_enqueue2(&sc->sc_if, ifq, m0
@@ -1079,6 +1080,7 @@
             */
            *mpp = m->m_nextpkt;
            m->m_nextpkt = NULL;
+           ifq = NULL;
            if (m->m_flags & M_HIGHPRI)
                ifq = &sc->sc_fastq;
            if ((error = ifq_enqueue2(&sc->sc_if, ifq, m ALTQ_COMMA



Home | Main Index | Thread Index | Old Index