Index: if.c =================================================================== RCS file: /cvs/src/sys/net/if.c,v retrieving revision 1.93 diff -u -r1.93 if.c --- if.c 14 Oct 2004 21:28:15 -0000 1.93 +++ if.c 3 Dec 2004 10:00:26 -0000 @@ -807,21 +807,28 @@ void if_congestion(struct ifqueue *ifq) { - static struct timeout to; + // Not currently needed, all callers check this + if (ifq->ifq_congestion) + return; - ifq->ifq_congestion = 1; - bzero(&to, sizeof(to)); - timeout_set(&to, if_congestion_clear, ifq); - timeout_add(&to, hz / 100); + ifq->ifq_congestion = malloc(sizeof(struct timeout), M_TEMP, M_NOWAIT); + if (ifq->ifq_congestion == NULL) + return; + timeout_set(ifq->ifq_congestion, if_congestion_clear, ifq); + timeout_add(ifq->ifq_congestion, hz / 100); } /* * clear the congestion flag */ void -if_congestion_clear(void *ifq) +if_congestion_clear(void *arg) { - ((struct ifqueue *)ifq)->ifq_congestion = 0; + struct ifqueue *ifq = arg; + struct timeout *to = ifq->ifq_congestion; + + ifq->ifq_congestion = NULL; + free(to, M_TEMP); } /* Index: if.h =================================================================== RCS file: /cvs/src/sys/net/if.h,v retrieving revision 1.59 diff -u -r1.59 if.h --- if.h 10 Nov 2004 21:10:53 -0000 1.59 +++ if.h 3 Dec 2004 10:00:32 -0000 @@ -141,7 +141,7 @@ int ifq_len; int ifq_maxlen; int ifq_drops; - int ifq_congestion; + struct timeout *ifq_congestion; }; /*