Commit 228da8b4 authored by Christopher Alfeld's avatar Christopher Alfeld
Browse files

Fixed bugs in tb-set-link-loss.

parent 0d8ef0e9
...@@ -160,13 +160,13 @@ proc tb-set-link-loss {srclink args} { ...@@ -160,13 +160,13 @@ proc tb-set-link-loss {srclink args} {
} }
} else { } else {
set reallink $srclink set reallink $srclink
set loss [lindex $args 0] set lossrate [lindex $args 0]
} }
if {([regexp $FLOAT $lossrate] == 0) || if {([regexp $FLOAT $lossrate] == 0) ||
($lossrate > 1.0)} { ($lossrate > 1.0)} {
perror "ERROR: tb-set-link-loss - $lossrate is not a valid loss rate." perror "ERROR: tb-set-link-loss - $lossrate is not a valid loss rate."
} }
$lan instvar loss $srclink instvar loss
set adjloss [expr 1-sqrt(1-$lossrate)] set adjloss [expr 1-sqrt(1-$lossrate)]
foreach pair [array names loss] { foreach pair [array names loss] {
set loss($pair) $adjloss set loss($pair) $adjloss
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment