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> {
.filter(constraint -> constraint instanceof EncapsulationConstraint)
.map(x -> (EncapsulationConstraint) x).findAny();
//if no encapsulation or is involved only a single switch use the default behaviour
if (!encapConstraint.isPresent() || links.size() == 1) {
if (!encapConstraint.isPresent() || links.size() == 2) {
for (int i = 0; i < links.size() - 1; i++) {
ConnectPoint ingress = links.get(i).dst();
ConnectPoint egress = links.get(i + 1).src();
......@@ -492,6 +492,7 @@ public class PathCompiler<T> {
ingress, egress, intent.priority(),
isLast(links, i), flows, devices);
}
return;
}
encapConstraint.map(EncapsulationConstraint::encapType)
......