Pier
Committed by Gerrit Code Review

Fix PathCompiler in case of VLAN encapsulation

constraint and 1 hop.

Change-Id: Iea82fb4076c79bfa3770836459ffe5f25b5a79c1
...@@ -484,7 +484,7 @@ public class PathCompiler<T> { ...@@ -484,7 +484,7 @@ public class PathCompiler<T> {
484 .filter(constraint -> constraint instanceof EncapsulationConstraint) 484 .filter(constraint -> constraint instanceof EncapsulationConstraint)
485 .map(x -> (EncapsulationConstraint) x).findAny(); 485 .map(x -> (EncapsulationConstraint) x).findAny();
486 //if no encapsulation or is involved only a single switch use the default behaviour 486 //if no encapsulation or is involved only a single switch use the default behaviour
487 - if (!encapConstraint.isPresent() || links.size() == 1) { 487 + if (!encapConstraint.isPresent() || links.size() == 2) {
488 for (int i = 0; i < links.size() - 1; i++) { 488 for (int i = 0; i < links.size() - 1; i++) {
489 ConnectPoint ingress = links.get(i).dst(); 489 ConnectPoint ingress = links.get(i).dst();
490 ConnectPoint egress = links.get(i + 1).src(); 490 ConnectPoint egress = links.get(i + 1).src();
...@@ -492,6 +492,7 @@ public class PathCompiler<T> { ...@@ -492,6 +492,7 @@ public class PathCompiler<T> {
492 ingress, egress, intent.priority(), 492 ingress, egress, intent.priority(),
493 isLast(links, i), flows, devices); 493 isLast(links, i), flows, devices);
494 } 494 }
495 + return;
495 } 496 }
496 497
497 encapConstraint.map(EncapsulationConstraint::encapType) 498 encapConstraint.map(EncapsulationConstraint::encapType)
......