! fix race condition on $childrunning when forking

This commit is contained in:
Manuel Kasper 2008-09-03 17:21:32 +00:00
parent 8680cd724d
commit 07eccf65bb
5 changed files with 14 additions and 5 deletions

10
README
View File

@ -1,8 +1,16 @@
AS-Stats v1 (2008-02-19)
AS-Stats v1.1 (2008-09-03)
a simple tool to generate per-AS traffic graphs from NetFlow records
by Manuel Kasper, Monzoon Networks AG <mkasper@monzoon.net>
--------------------------------------------------------------------
Changes
-------
v1.1 Fix for a potential race condition surrounding $childrunning
(reported by Yann Gauteron; experienced on a Linux system)
v1 Initial release
How it works
------------

View File

@ -144,13 +144,14 @@ sub flush_cache {
return;
}
$childrunning = 1;
my $pid = fork();
if (!defined $pid) {
$childrunning = 0;
print "cannot fork\n";
} elsif ($pid != 0) {
# in parent
$childrunning = 1;
$ascache_lastflush = time;
$ascache = {};
return;

View File

@ -55,7 +55,7 @@ AS: <input type="text" name="as" size="6" />
<?php endif; ?>
<div id="footer">
AS-Stats v1 written by Manuel Kasper, Monzoon Networks AG.
AS-Stats v1.1 written by Manuel Kasper, Monzoon Networks AG.
</div>
</body>

View File

@ -45,7 +45,7 @@ $class = (($i % 2) == 0) ? "even" : "odd";
</table>
<div id="footer">
AS-Stats v1 written by Manuel Kasper, Monzoon Networks AG.
AS-Stats v1.1 written by Manuel Kasper, Monzoon Networks AG.
</div>
</body>

View File

@ -90,7 +90,7 @@ foreach ($knownlinks as $link) {
</div>
<div id="footer">
AS-Stats v1 written by Manuel Kasper, Monzoon Networks AG.
AS-Stats v1.1 written by Manuel Kasper, Monzoon Networks AG.
</div>
</body>