diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2008-05-08 07:40:04 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2008-05-08 07:40:04 +0000 |
commit | f3e8e0f5664a933acae70de549cdd3ea36d52d8f (patch) | |
tree | 74cb121cafe2e689e473a2a91bb741998f9e0b15 /usr.sbin/bgpd | |
parent | a34d2dd3eecd99c6bbcb904e40ce0fce8f2ac26d (diff) |
in timer_set, when figuring out the right position for the timer,
wemust stop walking the list once werun into a stopped timer, or
eventually all stopped timers will queue up at the very front (instead of
at the tail)
Diffstat (limited to 'usr.sbin/bgpd')
-rw-r--r-- | usr.sbin/bgpd/kroute.c | 10 | ||||
-rw-r--r-- | usr.sbin/bgpd/timer.c | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/bgpd/kroute.c b/usr.sbin/bgpd/kroute.c index 12c1c091381..8734cc29add 100644 --- a/usr.sbin/bgpd/kroute.c +++ b/usr.sbin/bgpd/kroute.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kroute.c,v 1.157 2007/11/24 17:01:04 claudio Exp $ */ +/* $OpenBSD: kroute.c,v 1.158 2008/05/08 07:40:03 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -2030,6 +2030,8 @@ fetchtable(u_int rtableid, int connected_only) kr->r.flags = F_KERNEL; kr->r.ifindex = rtm->rtm_index; + if (rtm->rtm_index) + kr->r.flags |= F_CONNECTED; kr->r.prefix.s_addr = ((struct sockaddr_in *)sa)->sin_addr.s_addr; sa_in = (struct sockaddr_in *)rti_info[RTAX_NETMASK]; @@ -2062,6 +2064,8 @@ fetchtable(u_int rtableid, int connected_only) kr6->r.flags = F_KERNEL; kr6->r.ifindex = rtm->rtm_index; + if (rtm->rtm_index) + kr6->r.flags |= F_CONNECTED; memcpy(&kr6->r.prefix, &((struct sockaddr_in6 *)sa)->sin6_addr, sizeof(kr6->r.prefix)); @@ -2104,10 +2108,6 @@ fetchtable(u_int rtableid, int connected_only) sizeof(kr6->r.nexthop)); break; case AF_LINK: - if (sa->sa_family == AF_INET) - kr->r.flags |= F_CONNECTED; - else if (sa->sa_family == AF_INET6) - kr6->r.flags |= F_CONNECTED; break; } diff --git a/usr.sbin/bgpd/timer.c b/usr.sbin/bgpd/timer.c index 74093c62864..b2dce26e63a 100644 --- a/usr.sbin/bgpd/timer.c +++ b/usr.sbin/bgpd/timer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: timer.c,v 1.5 2008/05/08 06:52:13 henning Exp $ */ +/* $OpenBSD: timer.c,v 1.6 2008/05/08 07:40:03 henning Exp $ */ /* * Copyright (c) 2003-2007 Henning Brauer <henning@openbsd.org> @@ -88,7 +88,7 @@ timer_set(struct peer *p, enum Timer timer, u_int offset) pt->val = time(NULL) + offset; TAILQ_FOREACH(t, &p->timers, entry) - if (t->val > pt->val) + if (t->val == 0 || t->val > pt->val) break; if (t != NULL) TAILQ_INSERT_BEFORE(t, pt, entry); |