diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2008-05-08 06:52:14 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2008-05-08 06:52:14 +0000 |
commit | 67d2fc612e8ad4f91259fa4538b589eaafe90f73 (patch) | |
tree | 1c3da974374becf1232abfeacb3ce45459dbcbe2 /usr.sbin/bgpd/session.c | |
parent | 2220ab95d81e28cca3dccfd5b8858ac2d6e95efb (diff) |
change timer internals so that we use a timewheel (tailq, sorted by expiry
so that the timer that will expire first is always the first element,
and so on). will make the checking a bit faster and moreelegant and more
conveniant. ok claudio
Diffstat (limited to 'usr.sbin/bgpd/session.c')
-rw-r--r-- | usr.sbin/bgpd/session.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/bgpd/session.c b/usr.sbin/bgpd/session.c index 484640c07cd..729afaf1a8f 100644 --- a/usr.sbin/bgpd/session.c +++ b/usr.sbin/bgpd/session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: session.c,v 1.279 2007/12/23 18:56:17 henning Exp $ */ +/* $OpenBSD: session.c,v 1.280 2008/05/08 06:52:13 henning Exp $ */ /* * Copyright (c) 2003, 2004, 2005 Henning Brauer <henning@openbsd.org> @@ -317,6 +317,7 @@ session_main(struct bgpd_config *config, struct peer *cpeers, last->next = next; else peers = next; + timer_remove_all(p); free(p); peer_cnt--; continue; @@ -586,6 +587,7 @@ init_conf(struct bgpd_config *c) void init_peer(struct peer *p) { + TAILQ_INIT(&p->timers); p->fd = p->wbuf.fd = -1; if (p->conf.if_depend[0]) |