Commit 48368b9d authored by Jonathon Duerig's avatar Jonathon Duerig

Bugfix for stitching, added more error-handling.

parent c2f9bd96
...@@ -1738,6 +1738,10 @@ sub GetTicketAuxAux($$$$$$$$$) ...@@ -1738,6 +1738,10 @@ sub GetTicketAuxAux($$$$$$$$$)
"$node_nickname"); "$node_nickname");
goto bad; goto bad;
} }
if (defined($stitchpath->error())) {
$response = $stitchpath->error();
goto bad;
}
# XXX: This is completely bogus. There is no current # XXX: This is completely bogus. There is no current
# way to map interface refs in the link with # way to map interface refs in the link with
...@@ -2218,6 +2222,18 @@ sub GetTicketAuxAux($$$$$$$$$) ...@@ -2218,6 +2222,18 @@ sub GetTicketAuxAux($$$$$$$$$)
my $stitchpath = GeniStitch->Lookup($linkname); my $stitchpath = GeniStitch->Lookup($linkname);
my $slice_urn = $slice->urn(); my $slice_urn = $slice->urn();
my $retries = 10; my $retries = 10;
if (! defined($stitchpath)) {
$response =
GeniResponse->Create(GENIRESPONSE_ERROR, undef,
"$linkname: No stitching path");
goto bad;
}
if (defined($stitchpath->error())) {
$response = $stitchpath->error();
goto bad;
}
my $chainmode = ($stitchpath->mode() eq "chain" ? 1 : 0); my $chainmode = ($stitchpath->mode() eq "chain" ? 1 : 0);
my $madevlan = 0; my $madevlan = 0;
...@@ -2314,6 +2330,16 @@ sub GetTicketAuxAux($$$$$$$$$) ...@@ -2314,6 +2330,16 @@ sub GetTicketAuxAux($$$$$$$$$)
# #
while ($retries) { while ($retries) {
my $stitchpath = GeniStitch->Lookup($linkname); my $stitchpath = GeniStitch->Lookup($linkname);
if (! defined($stitchpath)) {
$response =
GeniResponse->Create(GENIRESPONSE_ERROR, undef,
"$linkname: No stitching path to ");
goto bad;
}
if (defined($stitchpath->error())) {
$response = $stitchpath->error();
goto bad;
}
# #
# Already have a reserved tag? This could happen if the other CM # Already have a reserved tag? This could happen if the other CM
......
...@@ -241,7 +241,8 @@ sub addStitchPoint($@) ...@@ -241,7 +241,8 @@ sub addStitchPoint($@)
return; return;
} }
foreach my $point ($self->points()) { foreach my $point ($self->points()) {
if (GeniXML::GetHopLinkID($point->{'internal'}) eq $internalurn) { my $pointurn = GeniXML::GetHopLinkID($point->{'internal_hop'});
if (defined($pointurn) && $pointurn eq $internalurn) {
# If there is just one stitch point, this may be a duplicate # If there is just one stitch point, this may be a duplicate
return; return;
} }
......
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