Commit 976312fa authored by Leigh B Stoller's avatar Leigh B Stoller

Fix for stitching across lans; need to reset the link_type to vlan

so that the SCS will accept it. Oh, and I learned that the SCS is
sensitive to the order of elements in the XML file! The link *must* be
after the nodes, or the SCS refuses to do anything with it. Sheesh.
parent c9a1a6f0
......@@ -1357,8 +1357,17 @@ sub SetSites($$$$$$)
return 1;
}
# if more then one site for a link, must use the stitcher.
$$pneedstitcher = 1
if (keys(%linksites) > 1);
if (keys(%linksites) > 1) {
$$pneedstitcher = 1;
#
# Oh, ugly. The stitcher will not accept the link if its
# link_type is set to "lan", which is what happens when
# use create a LAN() in geni-lib. So reset the link type
# to vlan since that is what the stitcher wants to see.
#
GeniXML::SetLinkType($ref, "vlan");
}
}
foreach my $ref (GeniXML::FindNodesNS("n:routable_pool", $rspec,
$GeniXML::EMULAB_NS)->get_nodelist()) {
......
......@@ -397,6 +397,34 @@ sub LinkType($)
return TunnelType($_[0]);
}
sub SetLinkType($$)
{
my ($link, $newtype) = @_;
return -1
if (IsVersion0($link));
print STDERR "SetLinkType: 1\n";
my @types = FindNodes("n:link_type", $link)->get_nodelist();
foreach my $type (@types) {
$link->removeChild($type);
print STDERR "SetLinkType: 2\n";
}
return 0
if (!defined($newtype));
print STDERR "SetLinkType: 3\n";
my $type = AddElement("link_type", $link);
return -1
if (!defined($type));
print STDERR "SetLinkType: 4\n";
SetText("name", $type, $newtype);
return 0;
}
sub IsLayer1($)
{
my $linktype = LinkType($_[0]);
......
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