Bug in OSPF
Ondrej Zajicek
santiago at crfreenet.org
Mon Aug 25 11:44:15 CEST 2008
On Mon, Aug 25, 2008 at 10:47:44AM +0200, Martin Mares wrote:
> I would very much like to avoid including anything in asm/... and especially
> using HZ. The proper way to get HZ is to call sysconf(_SC_CLK_TCK). This
> should be portable to all POSIX systems.
I supposed this variant to be linux 2.4 specific workaround and
clock_gettime() to be the portable one. The code has more linux-specific
assumtions (like that time_t is 32bit integer).
> Anyway, is there any problem in using time() as previously, but detect
> timewarps?
There are two ways to do it - the first one keeps 'now' variable monotonic
(using time() and detecting timewarps), the second keeps current time in
'now' variable and fixes its users (like event loop) to not suppose
monotonicity.
IMHO the first way does not have any advantages, 'now' variable wouldn't
have no well defined meaning, the second way is unnecessary hard.
Although later i found that some parts of bird suppose that 'now' contains
real time (some user outputs printing and password validity check) i think
it is more easy to fix these. For example when route appears, it gets
timestamp that is printed using 'show route'. Timestamp might be relative
monotonic time and during print i can compute the time of route appearance
by using current time() and offset between monotonic timers. This will show
correct time even when system tiwe was broken during route appearance.
--
Elen sila lumenn' omentielvo
Ondrej 'SanTiago' Zajicek (email: santiago at crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20080825/80d78d78/attachment-0001.asc>
More information about the Bird-users
mailing list