summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2010-07-09 15:44:21 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2010-07-09 15:44:21 +0000
commit74c8e65b12d50b84bca2cad414861a6a3de2ec89 (patch)
tree338bddd45bc3356e2ad5565efdba9eca250cee4c /sys/net
parent26c4cd9782328170d96bb0a2512781af5208a7d2 (diff)
Add the rtableid to struct rttimer and therefor make it available to
the callback functions. This fixes a problem where dynamic routes in different tables would not get deleted because the callback was doing the remove on the wrong table. OK henning@
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/route.c7
-rw-r--r--sys/net/route.h5
2 files changed, 7 insertions, 5 deletions
diff --git a/sys/net/route.c b/sys/net/route.c
index a4b26a7c677..07ae9d72d30 100644
--- a/sys/net/route.c
+++ b/sys/net/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.123 2010/07/02 00:20:49 jsg Exp $ */
+/* $OpenBSD: route.c,v 1.124 2010/07/09 15:44:20 claudio Exp $ */
/* $NetBSD: route.c,v 1.14 1996/02/13 22:00:46 christos Exp $ */
/*
@@ -1151,7 +1151,7 @@ static int rt_init_done = 0;
bzero(&info, sizeof(info)); \
info.rti_info[RTAX_DST] = rt_key(r->rtt_rt); \
rtrequest1(RTM_DELETE, &info, \
- r->rtt_rt->rt_priority, NULL, 0 /* XXX */); \
+ r->rtt_rt->rt_priority, NULL, r->rtt_tableid); \
} \
}
@@ -1249,7 +1249,7 @@ rt_timer_remove_all(struct rtentry *rt)
int
rt_timer_add(struct rtentry *rt, void (*func)(struct rtentry *,
- struct rttimer *), struct rttimer_queue *queue)
+ struct rttimer *), struct rttimer_queue *queue, u_int rtableid)
{
struct rttimer *r;
long current_time;
@@ -1283,6 +1283,7 @@ rt_timer_add(struct rtentry *rt, void (*func)(struct rtentry *,
r->rtt_time = current_time;
r->rtt_func = func;
r->rtt_queue = queue;
+ r->rtt_tableid = rtableid;
LIST_INSERT_HEAD(&rt->rt_timer, r, rtt_link);
TAILQ_INSERT_TAIL(&queue->rtq_head, r, rtt_next);
r->rtt_queue->rtq_count++;
diff --git a/sys/net/route.h b/sys/net/route.h
index 2421f795153..5c97082cebd 100644
--- a/sys/net/route.h
+++ b/sys/net/route.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.h,v 1.70 2010/06/29 21:28:37 reyk Exp $ */
+/* $OpenBSD: route.h,v 1.71 2010/07/09 15:44:20 claudio Exp $ */
/* $NetBSD: route.h,v 1.9 1996/02/13 22:00:49 christos Exp $ */
/*
@@ -310,6 +310,7 @@ struct rttimer {
void (*rtt_func)(struct rtentry *,
struct rttimer *);
time_t rtt_time; /* When this timer was registered */
+ u_int rtt_tableid; /* routing table id of rtt_rt */
};
struct rttimer_queue {
@@ -373,7 +374,7 @@ void rt_setmetrics(u_long, struct rt_metrics *, struct rt_kmetrics *);
void rt_getmetrics(struct rt_kmetrics *, struct rt_metrics *);
int rt_timer_add(struct rtentry *,
void(*)(struct rtentry *, struct rttimer *),
- struct rttimer_queue *);
+ struct rttimer_queue *, u_int);
void rt_timer_init(void);
struct rttimer_queue *
rt_timer_queue_create(u_int);