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

[altq 730] Re: small ALTQ bug




Lars Eggert wrote:
> The two patches below fix the problem, maybe you'd like to apply them to
> the CVS tree anyway:

Just committed to the KAME CVS tree with slight modifications.

> Index: altq/altq_classq.h
> ===================================================================
> RCS file: /home/xbone/CVSROOT/kame/kame/sys/altq/altq_classq.h,v
> retrieving revision 1.1.1.1
> diff -u -r1.1.1.1 altq_classq.h
> --- altq/altq_classq.h  2001/01/24 20:05:27     1.1.1.1
> +++ altq/altq_classq.h  2001/02/06 20:33:22
> @@ -95,8 +95,10 @@
>         
>         if ((m0 = qtail(q)) != NULL)
>                 m->m_nextpkt = m0->m_nextpkt;
> -       else
> +       else {
> +               m->m_nextpkt = NULL;
>                 m0 = m;
> +       }
>         m0->m_nextpkt = m;
>         qtail(q) = m;
>         qlen(q)++;

This isn't necessary; m0 points to m when the queue is empty.
(m_nextpkt creates a ring, and points to itself if it's the only one
in the queue.)

> @@ -114,6 +116,7 @@
>         else
>                 qtail(q) = NULL;
>         qlen(q)--;
> +       m->m_nextpkt = NULL;
>         return (m0); 
>  }

m should be m0.  (your version for altq_rmclass.c is correct.)

-Kenjiro