Source-Changes-HG archive

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

[src/trunk]: src/sys/net Fix braino in IF_PURGE().



details:   https://anonhg.NetBSD.org/src/rev/39bcfc60c45f
branches:  trunk
changeset: 500570:39bcfc60c45f
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Thu Dec 14 00:19:42 2000 +0000

description:
Fix braino in IF_PURGE().

diffstat:

 sys/net/if.h |  15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diffs (29 lines):

diff -r b4e5b363b6f2 -r 39bcfc60c45f sys/net/if.h
--- a/sys/net/if.h      Thu Dec 14 00:13:07 2000 +0000
+++ b/sys/net/if.h      Thu Dec 14 00:19:42 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if.h,v 1.56 2000/12/14 00:07:35 thorpej Exp $  */
+/*     $NetBSD: if.h,v 1.57 2000/12/14 00:19:42 thorpej Exp $  */
 
 /*-
  * Copyright (c) 1999, 2000 The NetBSD Foundation, Inc.
@@ -358,11 +358,14 @@
 #define        IF_PURGE(ifq)                                                   \
 do {                                                                   \
        struct mbuf *__m0;                                              \
-       IF_DEQUEUE((ifq), __m0);                                        \
-       if (__m0 == NULL)                                               \
-               break;                                                  \
-       else                                                            \
-               m_freem(__m0);                                          \
+                                                                       \
+       for (;;) {                                                      \
+               IF_DEQUEUE((ifq), __m0);                                \
+               if (__m0 == NULL)                                       \
+                       break;                                          \
+               else                                                    \
+                       m_freem(__m0);                                  \
+       }                                                               \
 } while (0)
 #define        IF_IS_EMPTY(ifq)        ((ifq)->ifq_len == 0)
 



Home | Main Index | Thread Index | Old Index