From f3c9bcbcc44421a8f0ec6563a3123e130a6888aa Mon Sep 17 00:00:00 2001 From: tgoff0 Date: Fri, 22 May 2015 00:54:59 +0000 Subject: [PATCH] fixed bug with lsearch for display for olsr --- gui/widget.tcl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/gui/widget.tcl b/gui/widget.tcl index 67611706..5e5b46e5 100644 --- a/gui/widget.tcl +++ b/gui/widget.tcl @@ -1916,14 +1916,14 @@ proc get_router_id {node} { return [string range $line 11 end] } } - if {[lsearch [getNodeServices $node true] "OLSR"] == 0 } { + if {[lsearch [getNodeServices $node true] "OLSR"] != -1 } { set sock [lindex [getEmulPlugin $node] 2] set exec_num [newExecCallbackRequest adjacencyrouterid] set cmd "nrlConsole.py ${node}_olsr i" sendExecMessage $sock $node $cmd $exec_num 0x30 return "" - } elseif {[lsearch [getNodeServices $node true] "OLSRv2"] == 0 } { + } elseif {[lsearch [getNodeServices $node true] "OLSRv2"] != -1 } { set sock [lindex [getEmulPlugin $node] 2] set exec_num [newExecCallbackRequest adjacencyrouterid] set cmd "nrlConsole.py ${node}_olsrv2 i" @@ -2021,7 +2021,6 @@ proc widget_adjacency_periodic { now } { set changed 0 set proto $adjacency_config(proto) - if { $proto == "OLSR_proto" } { foreach node $node_list { if { [nodeType $node] != "router" } { continue } @@ -2130,12 +2129,13 @@ proc exec_adjacencyrouterid_callback { node execnum cmd result status } { global adjacency_cache #check if olsr or olsrv2 are running - if {[lsearch [getNodeServices $node true] "OLSR"] == 0 || - [lsearch [getNodeServices $node true] "OLSRv2"] == 0 } { + if {[lsearch [getNodeServices $node true] "OLSR"] != -1 || + [lsearch [getNodeServices $node true] "OLSRv2"] != -1 } { set lines [split $result "\n"] set rtrid [lindex $lines 1] array set adjacency_cache [list $rtrid $node] } else { + puts "matches OSPFv2" # match both OSPFv2 and OSPFv3 responses set rid [regexp -inline {Router[- ]ID[:]? [0-9]+\.[0-9]+\.[0-9]+\.[0-9]+} \ $result]