]> git.ipfire.org Git - thirdparty/tor.git/commit
Monotonize the OOM-killer data timers
authorNick Mathewson <nickm@torproject.org>
Wed, 26 Feb 2014 14:51:30 +0000 (09:51 -0500)
committerNick Mathewson <nickm@torproject.org>
Wed, 26 Feb 2014 14:51:30 +0000 (09:51 -0500)
commit833d027778ba97020fb5ded1d94e4b21fbcab766
treed7e3d9b859cc8da448e0620b8f95ca25f22c5733
parent79c234e0e3fa22d76029bd3b5e2c52072709cff3
Monotonize the OOM-killer data timers

In a couple of places, to implement the OOM-circuit-killer defense
against sniper attacks, we have counters to remember the age of
cells or data chunks.  These timers were based on wall clock time,
which can move backwards, thus giving roll-over results for our age
calculation.  This commit creates a low-budget monotonic time, based
on ratcheting gettimeofday(), so that even in the event of a time
rollback, we don't do anything _really_ stupid.

A future version of Tor should update this function to do something
even less stupid here, like employ clock_gettime() or its kin.
src/common/compat_libevent.c
src/common/compat_libevent.h
src/or/buffers.c
src/or/circuitlist.c
src/or/relay.c