Commit 9eebc3f4 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Fixes for loopback links.

parent 00f3aea8
......@@ -664,27 +664,33 @@ sub MapNodes($$)
}
$node = $pnode;
}
my $interface = Interface->LookupByIface($node,$iface);
if (!defined($interface)) {
print STDERR "Could not map iface for $node,$iface\n";
print STDERR "$manifest_string\n";
return -1;
}
if (!defined($MAC)) {
print STDERR "No mac (or vmac) for $node,$iface\n";
print STDERR "$manifest_string\n";
return -1;
}
if (! ($MAC =~ /^[\w]*$/)) {
print STDERR "Bad mac '$MAC' for $node,$iface\n";
print STDERR "$manifest_string\n";
return -1;
}
if ($interface->Update({"mac" => "$MAC"})) {
print STDERR "Could not update $node,$iface\n";
print STDERR "$manifest_string\n";
return -1;
#
# If the interface is the loopback, then we do not need
# to do this.
#
if ($iface ne "lo0" && $iface ne "loopback") {
my $interface = Interface->LookupByIface($node,$iface);
if (!defined($interface)) {
print STDERR "Could not map iface for $node,$iface\n";
print STDERR "$manifest_string\n";
return -1;
}
if (!defined($MAC)) {
print STDERR "No mac (or vmac) for $node,$iface\n";
print STDERR "$manifest_string\n";
return -1;
}
if (! ($MAC =~ /^[\w]*$/)) {
print STDERR "Bad mac '$MAC' for $node,$iface\n";
print STDERR "$manifest_string\n";
return -1;
}
if ($interface->Update({"mac" => "$MAC"})) {
print STDERR "Could not update $node,$iface\n";
print STDERR "$manifest_string\n";
return -1;
}
}
if (defined($VMAC)) {
my $vinterface =
......
......@@ -3368,6 +3368,7 @@ sub ReadRspecSolution($$)
if (scalar(@ifacerefs) == 2) {
my ($ifaceA,$ifaceB) = @ifacerefs;
my $trivial = 0;
my $virtA = $ifaceA->{'virtual_interface_id'};
my $virtB = $ifaceB->{'virtual_interface_id'};
......@@ -3377,10 +3378,15 @@ sub ReadRspecSolution($$)
my $nodeB = $self->solution()->{'V2P'}->{$vnodeB};
my $portA = $ifacemap{$vnodeA}->{$virtA};
my $portB = $ifacemap{$vnodeB}->{$virtB};
my $vlink = "linksimple/$virtual_id/$virtA,$virtB";
if ($portA eq "loopback" || $portB eq "loopback") {
$nodeA = $nodeB = $portA = $portB = undef;
$trivial = 1;
$virtlan->_trivial_ok(1);
}
my $vlink = "linksimple/$virtual_id/$virtA,$virtB";
$self->AddLinkToSolution($vlink, 0, 0,
$self->AddLinkToSolution($vlink, $trivial, 0,
$nodeA, $portA, $nodeB, $portB);
}
else {
......
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