mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-29 10:08:53 +00:00
internet_checksum.run: don't use bad trafgen seeds
This commit is contained in:
parent
e5c0d5247e
commit
e64b07d7a4
@ -17,13 +17,21 @@ proc exit {{code 0}} {
|
||||
build { core init lib/ld lib/vfs test/internet_checksum server/lx_fs }
|
||||
create_boot_directory
|
||||
|
||||
set seed ""
|
||||
proc gen_seed { } {
|
||||
set min_seed 0
|
||||
set max_seed [expr 2**32]
|
||||
return [expr int($min_seed + floor(rand() * $max_seed))]
|
||||
}
|
||||
|
||||
set seed 0
|
||||
if {[info exists ::env(SEED)]} {
|
||||
set seed $::env(SEED)
|
||||
} else {
|
||||
set min_seed 0
|
||||
set max_seed [expr 2**32]
|
||||
set seed [expr int($min_seed + floor(rand() * $max_seed))]
|
||||
# in some cases trafgen generates bad checksums in encapsulated packets
|
||||
set bad_seeds [list 0 875727356 ]
|
||||
while {[lsearch -exact $bad_seeds $seed] != -1} {
|
||||
set seed [gen_seed]
|
||||
}
|
||||
}
|
||||
puts "\nUse script with SEED=$seed in order to get reproducible results\n"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user