Commit d883d8c5 authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Fix for how we record the physical MACs in the proxy node interfaces.

parent ebdff502
......@@ -590,6 +590,7 @@ sub MapNodes($$)
my $vname = $ifaceref->{'virtual_node_id'};
my $iface_id = $ifaceref->{'virtual_interface_id'};
my $MAC = $ifaceref->{'MAC'};
my $VMAC = $ifaceref->{'VMAC'};
my ($node, $compid) = @{ $ifacemap{$iface_id} };
my $iface;
......@@ -605,21 +606,22 @@ sub MapNodes($$)
print STDERR Dumper($manifest);
return -1;
}
#
# XXX At this point, not sure if the interface is a
# vinterface or a real interface.
# If this is a virtual node, then we want to set the
# MACs of the underlying physical node. The vinterface
# (VMAC) will be handled below.
#
my $interface =
Interface::VInterface->LookupByVirtLan($experiment,
$linkname,
$vname);
if (defined($interface)) {
$MAC = $ifaceref->{'VMAC'};
}
else {
$interface = Interface->LookupByIface($node,$iface);
if ($node->isvirtnode()) {
my $pnode = $node->GetPhysHost();
if (!defined($pnode)) {
print STDERR "Could not physical node for $node\n";
print STDERR Dumper($manifest);
return -1;
}
$node = $pnode;
}
my $interface = Interface->LookupByIface($node,$iface);
if (!defined($interface)) {
print STDERR "Could not map iface for $node,$iface\n";
print STDERR Dumper($manifest);
......@@ -640,6 +642,28 @@ sub MapNodes($$)
print Dumper($manifest);
return -1;
}
if (defined($VMAC)) {
my $vinterface =
Interface::VInterface->LookupByVirtLan($experiment,
$linkname,
$vname);
if (!defined($vinterface)) {
print STDERR
"Could not map vinterface for $linkname,$vname\n";
print STDERR Dumper($manifest);
return -1;
}
if (! ($VMAC =~ /^[\w]*$/)) {
print STDERR "Bad vmac '$VMAC' for $linkname,$vname\n";
print STDERR Dumper($manifest);
return -1;
}
if ($vinterface->Update({"mac" => "$VMAC"})) {
print STDERR "Could not update $linkname,$vname\n";
print Dumper($manifest);
return -1;
}
}
}
}
# The manifest was changed above.
......
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