From 2f1c84899fd858cf603b70e48082215743652d81 Mon Sep 17 00:00:00 2001 From: rd235 Date: Tue, 2 Jun 2009 07:58:55 +0000 Subject: [PATCH] BUGFIX: timing error on wirefilter/markov mode. some minor fix on the wirefilter man page git-svn-id: https://vde.svn.sourceforge.net/svnroot/vde/trunk@366 d37a7db1-d92d-0410-89df-f68f52f87b57 --- vde-2/man/wirefilter.1 | 6 +++--- vde-2/src/wirefilter.c | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/vde-2/man/wirefilter.1 b/vde-2/man/wirefilter.1 index ec4a896..d54d6fc 100644 --- a/vde-2/man/wirefilter.1 +++ b/vde-2/man/wirefilter.1 @@ -174,8 +174,8 @@ emulation is deleted, node 0 becomes the current node. (The emulation always starts from node 0). .TP .B markov-time "\fIms\fP" -time period (ms) for the markov chain computation. Each $ms$ microseconds -a random number generator decides which is the next state. +time period (ms) for the markov chain computation. Each \fIms\fR microseconds +a random number generator decides which is the next state (default value=100ms). .TP .B markov-name "\fIn,name\fP" assign a name to a node of the markov chain. @@ -184,7 +184,7 @@ assign a name to a node of the markov chain. manually set the current node to the node \fIn\fP. .TP .B setedge "\fIn1,n2,w\fP" -define an edge between $n1$ and $n2$. $w$ is the weight (probability percentage) +define an edge between \fIn1\fR and \fIn2\fR; \fIw\fR is the weight (probability percentage) of the edge. The loopback edge (from a node to itself) is always computed as 100% minus the sum of the weights of outgoing edges. diff --git a/vde-2/src/wirefilter.c b/vde-2/src/wirefilter.c index 95bed90..0b417b7 100644 --- a/vde-2/src/wirefilter.c +++ b/vde-2/src/wirefilter.c @@ -1593,7 +1593,8 @@ int main(int argc,char *argv[]) while(1) { int delay=nextms(); int markovdelay=markovms(); - if (markovdelay < delay || delay < 0) delay=markovdelay; + if (markovdelay >= 0 && + (markovdelay < delay || delay < 0)) delay=markovdelay; pfd[0].events |= POLLIN; if (WFVAL(markov_current,SPEED,LR).value > 0) { struct timeval tv; -- 2.11.4.GIT