fixed adj widget to use node names instead of node id which would cause a crash if the names were changed using olsrv1/olsrv2

From: dean
This commit is contained in:
Tom Goff 2015-08-28 17:54:22 -04:00
parent 339cc7c4d7
commit 002f9aee76

View file

@ -1934,13 +1934,15 @@ proc get_router_id {node} {
set sock [lindex [getEmulPlugin $node] 2] set sock [lindex [getEmulPlugin $node] 2]
set exec_num [newExecCallbackRequest adjacencyrouterid] set exec_num [newExecCallbackRequest adjacencyrouterid]
set cmd "nrlConsole.py ${node}_olsr i" set name [getNodeName $node]
set cmd "nrlConsole.py ${name}_olsr i"
sendExecMessage $sock $node $cmd $exec_num 0x30 sendExecMessage $sock $node $cmd $exec_num 0x30
return "" return ""
} elseif {[lsearch [getNodeServices $node true] "OLSRv2"] != -1 } { } elseif {[lsearch [getNodeServices $node true] "OLSRv2"] != -1 } {
set sock [lindex [getEmulPlugin $node] 2] set sock [lindex [getEmulPlugin $node] 2]
set exec_num [newExecCallbackRequest adjacencyrouterid] set exec_num [newExecCallbackRequest adjacencyrouterid]
set cmd "nrlConsole.py ${node}_olsrv2 i" set name [getNodeName $node]
set cmd "nrlConsole.py ${name}_olsrv2 i"
sendExecMessage $sock $node $cmd $exec_num 0x30 sendExecMessage $sock $node $cmd $exec_num 0x30
return "" return ""
} }
@ -2047,7 +2049,8 @@ proc widget_adjacency_periodic { now } {
# widget_adjacency_callback after the response has been received # widget_adjacency_callback after the response has been received
set sock [lindex [getEmulPlugin $node] 2] set sock [lindex [getEmulPlugin $node] 2]
set exec_num [newExecCallbackRequest adjacency] set exec_num [newExecCallbackRequest adjacency]
set cmd "nrlConsole.py ${node}_olsr n" set name [getNodeName $node]
set cmd "nrlConsole.py ${name}_olsr n"
sendExecMessage $sock $node $cmd $exec_num 0x30 sendExecMessage $sock $node $cmd $exec_num 0x30
} }
} elseif { $proto == "OLSRv2_proto" } { } elseif { $proto == "OLSRv2_proto" } {
@ -2062,7 +2065,8 @@ proc widget_adjacency_periodic { now } {
# widget_adjacency_callback after the response has been received # widget_adjacency_callback after the response has been received
set sock [lindex [getEmulPlugin $node] 2] set sock [lindex [getEmulPlugin $node] 2]
set exec_num [newExecCallbackRequest adjacency] set exec_num [newExecCallbackRequest adjacency]
set cmd "nrlConsole.py ${node}_olsrv2 n" set name [getNodeName $node]
set cmd "nrlConsole.py ${name}_olsrv2 n"
sendExecMessage $sock $node $cmd $exec_num 0x30 sendExecMessage $sock $node $cmd $exec_num 0x30
} }
} else { } else {