Commit 773ed48b authored by Shashi Guruprasad's avatar Shashi Guruprasad

Bug Fix: If there were more than 1 real-simulated link between a real

and a simulated node, things failed
parent 237e9cf1
...@@ -228,11 +228,11 @@ if { $simcode_present == 1 } { ...@@ -228,11 +228,11 @@ if { $simcode_present == 1 } {
set i 0 set i 0
foreach nodeinst [Node info instances] { foreach nodeinst [Node info instances] {
if { [$nodeinst info vars nsenode_ipaddr] == {} } { if { [$nodeinst info vars nsenode_ipaddrlist] == {} } {
continue continue
} }
set nodeinst_ipaddr [$nodeinst set nsenode_ipaddr] set nodeinst_ipaddrlist [$nodeinst set nsenode_ipaddrlist]
if { $nodeinst_ipaddr != {} } { foreach nodeinst_ipaddr $nodeinst_ipaddrlist {
set iface [getif $nodeinst_ipaddr] set iface [getif $nodeinst_ipaddr]
# one iptap per node that has real - simulated link # one iptap per node that has real - simulated link
......
...@@ -228,11 +228,11 @@ if { $simcode_present == 1 } { ...@@ -228,11 +228,11 @@ if { $simcode_present == 1 } {
set i 0 set i 0
foreach nodeinst [Node info instances] { foreach nodeinst [Node info instances] {
if { [$nodeinst info vars nsenode_ipaddr] == {} } { if { [$nodeinst info vars nsenode_ipaddrlist] == {} } {
continue continue
} }
set nodeinst_ipaddr [$nodeinst set nsenode_ipaddr] set nodeinst_ipaddrlist [$nodeinst set nsenode_ipaddrlist]
if { $nodeinst_ipaddr != {} } { foreach nodeinst_ipaddr $nodeinst_ipaddrlist {
set iface [getif $nodeinst_ipaddr] set iface [getif $nodeinst_ipaddr]
# one iptap per node that has real - simulated link # one iptap per node that has real - simulated link
......
...@@ -66,7 +66,7 @@ Node instproc init {s} { ...@@ -66,7 +66,7 @@ Node instproc init {s} {
$self set simulated 0 $self set simulated 0
$self set nsenode "" $self set nsenode ""
} }
$self set nsenode_vport "" $self set nsenode_vportlist {}
} }
# The following procs support renaming (see README) # The following procs support renaming (see README)
......
...@@ -73,10 +73,15 @@ NSENode instproc updatedb {DB} { ...@@ -73,10 +73,15 @@ NSENode instproc updatedb {DB} {
append nseconfig "\n\n\$$node set simulated 1\n" append nseconfig "\n\n\$$node set simulated 1\n"
append nseconfig "\$$node set nsenode $self\n" append nseconfig "\$$node set nsenode $self\n"
set nsenode_vport [$node set nsenode_vport] set nsenode_vportlist [$node set nsenode_vportlist]
if { $nsenode_vport != {} } { if { $nsenode_vportlist != {} } {
append nseconfig "\$$node set nsenode_vport $nsenode_vport\n" append nseconfig "\$$node set nsenode_vportlist \[list $nsenode_vportlist]\n"
append nseconfig "\$$node set nsenode_ipaddr [$self ip $nsenode_vport]\n\n"
set ipaddrlist {}
foreach v $nsenode_vportlist {
lappend ipaddrlist [$self ip $v]
}
append nseconfig "\$$node set nsenode_ipaddrlist \[list $ipaddrlist]\n\n"
} }
} }
} }
......
...@@ -192,7 +192,9 @@ Simulator instproc duplex-link {n1 n2 bw delay type args} { ...@@ -192,7 +192,9 @@ Simulator instproc duplex-link {n1 n2 bw delay type args} {
# goes into NSE # goes into NSE
if { $simnode != {} } { if { $simnode != {} } {
set vport [[$simnode set nsenode] find_port $curlink] set vport [[$simnode set nsenode] find_port $curlink]
$simnode set nsenode_vport $vport set vportlist [$simnode set nsenode_vportlist]
lappend vportlist $vport
$simnode set nsenode_vportlist $vportlist
} }
set last_class $curlink set last_class $curlink
......
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