diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2005-11-04 10:50:55 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2005-11-04 10:50:55 +0000 |
commit | 31187dcd35d3e523d4132d95e6f2b695cf12cae0 (patch) | |
tree | 90527a8f5b3c17aa7e9d49ed358afca02fe69f7c | |
parent | 1c2b7fa507934e3cf9d39f2a6bd6a443216edd32 (diff) |
Set the vertex timestamp as soon as possible giving ospfd a chance to recover
from time jumps.
-rw-r--r-- | usr.sbin/ospfd/rde_lsdb.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/ospfd/rde_lsdb.c b/usr.sbin/ospfd/rde_lsdb.c index 08b806b880c..d3dc969794d 100644 --- a/usr.sbin/ospfd/rde_lsdb.c +++ b/usr.sbin/ospfd/rde_lsdb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rde_lsdb.c,v 1.21 2005/10/12 09:08:25 claudio Exp $ */ +/* $OpenBSD: rde_lsdb.c,v 1.22 2005/11/04 10:50:54 claudio Exp $ */ /* * Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org> @@ -393,6 +393,9 @@ lsa_age(struct vertex *v) now = time(NULL); d = now - v->stamp; + /* set stamp so that at least new calls work */ + v->stamp = now; + if (d < 0) { log_warnx("lsa_age: time went backwards"); return; @@ -405,7 +408,6 @@ lsa_age(struct vertex *v) age += d; v->lsa->hdr.age = htons(age); - v->stamp = now; } struct vertex * |