[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[ns] bug in ns-lib.tcl




Hello all,


There is a bug in the proc bw_parse defined in ns-lib.tcl: parsing of
bandwidth expressed in [kM]byte/s units is broken (symptom: MB/s or kB/s
is interpreted as bit/s)

Reason: parameters to 'string trimright' (line 83) are in the wrong
order.


% diff -C 2 OLD_ns-lib.tcl ns-lib.tcl
*** ORIGINAL__ns-lib.tcl      Tue Apr 24 14:11:35 2001
--- ns-lib.tcl  Tue Apr 24 14:11:54 2001
***************
*** 81,85 ****
        if [string match {*B} $unit] {
                set b [expr $b*8]
!               set unit "[string trimright B $unit]b"
        }
        switch $unit {
--- 81,85 ----
        if [string match {*B} $unit] {
                set b [expr $b*8]
!               set unit "[string trimright $unit B]b"
        }
        switch $unit {


Version info:
- ns-lib.tcl version 1.212
- ns 2.1b7 (distribution "allinone" + some patches)
- SunOS 5.7


Greetings,

David Ros.