add an argument to rt_timer_remove_all(), to specify if we need to call

timeout routine on removal.
This commit is contained in:
itojun 2002-11-12 01:37:30 +00:00
parent 96c9d84cda
commit 96910acf99
2 changed files with 9 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: route.c,v 1.53 2002/08/26 01:42:28 thorpej Exp $ */
/* $NetBSD: route.c,v 1.54 2002/11/12 01:37:30 itojun Exp $ */
/*-
* Copyright (c) 1998 The NetBSD Foundation, Inc.
@ -102,7 +102,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.53 2002/08/26 01:42:28 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: route.c,v 1.54 2002/11/12 01:37:30 itojun Exp $");
#include "opt_ns.h"
@ -251,7 +251,7 @@ rtfree(rt)
printf("rtfree: %p not freed (neg refs)\n", rt);
return;
}
rt_timer_remove_all(rt);
rt_timer_remove_all(rt, 0);
ifa = rt->rt_ifa;
IFAFREE(ifa);
Free(rt_key(rt));
@ -952,14 +952,17 @@ rt_timer_count(rtq)
}
void
rt_timer_remove_all(rt)
rt_timer_remove_all(rt, destroy)
struct rtentry *rt;
int destroy;
{
struct rttimer *r;
while ((r = LIST_FIRST(&rt->rt_timer)) != NULL) {
LIST_REMOVE(r, rtt_link);
TAILQ_REMOVE(&r->rtt_queue->rtq_head, r, rtt_next);
if (destroy)
RTTIMER_CALLOUT(r);
if (r->rtt_queue->rtq_count > 0)
r->rtt_queue->rtq_count--;
else

View File

@ -1,4 +1,4 @@
/* $NetBSD: route.h,v 1.30 2002/11/02 07:26:57 perry Exp $ */
/* $NetBSD: route.h,v 1.31 2002/11/12 01:37:30 itojun Exp $ */
/*
* Copyright (c) 1980, 1986, 1993
@ -303,7 +303,7 @@ struct rttimer_queue *
rt_timer_queue_create __P((u_int));
void rt_timer_queue_change __P((struct rttimer_queue *, long));
void rt_timer_queue_destroy __P((struct rttimer_queue *, int));
void rt_timer_remove_all __P((struct rtentry *));
void rt_timer_remove_all __P((struct rtentry *, int));
unsigned long rt_timer_count __P((struct rttimer_queue *));
void rt_timer_timer __P((void *));
void rtable_init __P((void **));