Commit 0b2c2dcc authored by Leigh B Stoller's avatar Leigh B Stoller

Some fixes to previous revision wrt not using a linked vlan for a vlan

encapsulated link; the vinterfaces were not getting updated properly.

I am not happy with the change mentioned above, but I needed it to
make vlan tag pre-reservations work; the encapsulation vlan has a
generated name, and that is hard to match up with the tag that is
reserved before the experiment is created, as from the protogeni
interface when stitching. I plan to come back and redo this after the
GEC.
parent 556c7f3d
......@@ -6929,24 +6929,30 @@ sub UploadVlans($)
foreach my $lan (@lans) {
# Only care about encapsulated links.
next
if ($lan->type() ne "emulated");
if (! ($lan->type() eq "emulated" ||
$lan->type() eq "vlan"));
my $linkedlan = $lan->GetLinkedLan();
if (!defined($linkedlan)) {
tberror("Emulated lan $lan does not have a linked vlan!\n");
return -1;
}
my $virtlan = $self->vlans()->{$lan->vname()};
if (!defined($virtlan)) {
tberror("Could not find lan $lan in local lan list!\n");
return -1;
}
my $virtlanidx = $virtlan->idx();
my $linkedlanid = $linkedlan->lanid();
$self->printdb("Update vinterfaces: $virtlan: ".
"$virtlanidx -> $linkedlanid\n");
my $linkedlanid = $lan->lanid();
#
# An encapsulated lan is linked to the real lan.
# A vlan encapsulated link does not have a linked lan;
# there is no need for it.
#
if ($lan->type() eq "emulated") {
my $linkedlan = $lan->GetLinkedLan();
if (!defined($linkedlan)) {
tberror("Emulated lan $lan does not have a linked vlan!\n");
return -1;
}
$linkedlanid = $linkedlan->lanid();
}
DBQueryWarn("update vinterfaces set vlanid='$linkedlanid' ".
"where virtlanidx='$virtlanidx' and ".
" exptidx='$exptidx'")
......
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