When PHP was perfromed in the src router of any subtunnel (meaning that there is no ID to push in the sub-tunnel), then NW TTL is decremented.
Change-Id: I1102585db907fbdcda17cd77eca885ca6228bc78
diff --git a/src/main/java/net/onrc/onos/apps/segmentrouting/SegmentRoutingManager.java b/src/main/java/net/onrc/onos/apps/segmentrouting/SegmentRoutingManager.java
index 2d90495..fbc9597 100644
--- a/src/main/java/net/onrc/onos/apps/segmentrouting/SegmentRoutingManager.java
+++ b/src/main/java/net/onrc/onos/apps/segmentrouting/SegmentRoutingManager.java
@@ -1347,6 +1347,14 @@
for (TunnelRouteInfo route : routes) {
List<Action> actions = new ArrayList<>();
+
+ // Check PHP was done by stitching
+ // If no MPLS label is added, then NW TTL needs to be decremented
+ if (route.getRoute().isEmpty()) {
+ DecNwTtlAction decNwTtlAction = new DecNwTtlAction(1);
+ actions.add(decNwTtlAction);
+ }
+
GroupAction groupAction = new GroupAction();
groupAction.setGroupId(route.getGroupId());
actions.add(groupAction);
@@ -2383,11 +2391,7 @@
logStr.append(" then ");
}
else if (m instanceof PacketMatch) {
- GroupAction ga = (GroupAction)actions.get(0);
- logStr.append("if the policy match is XXX then go to group " +
- ga.getGroupId());
- log.debug(logStr.toString());
- return;
+ logStr.append("if the policy match is XXX then ");
}
logStr.append(" do { ");
@@ -2405,7 +2409,6 @@
logStr.append("Forward packet to < ");
NeighborSet dpids = ((GroupAction) action).getDpids();
logStr.append(dpids.toString() + ",");
-
}
else if (action instanceof PopMplsAction) {
logStr.append("Pop MPLS label, ");