Change default available MPLS label range
- Follow IANA assignments, and
align with old resource service behavior
Change-Id: I1b7c96707842cf8e6f0f13cff99fa0eda8230263
diff --git a/core/net/src/main/java/org/onosproject/net/newresource/impl/ResourceDeviceListener.java b/core/net/src/main/java/org/onosproject/net/newresource/impl/ResourceDeviceListener.java
index a1e545f..ae60d50 100644
--- a/core/net/src/main/java/org/onosproject/net/newresource/impl/ResourceDeviceListener.java
+++ b/core/net/src/main/java/org/onosproject/net/newresource/impl/ResourceDeviceListener.java
@@ -63,7 +63,11 @@
private static final int MAX_VLAN_ID = VlanId.MAX_VLAN;
private static final List<VlanId> ENTIRE_VLAN_IDS = getEntireVlans();
- private static final int MAX_MPLS_LABEL = 1048576;
+ // Ref: http://www.iana.org/assignments/mpls-label-values/mpls-label-values.xhtml
+ // Smallest non-reserved MPLS label
+ private static final int MIN_UNRESERVED_LABEL = 0x10;
+ // Max non-reserved MPLS label = 239
+ private static final int MAX_UNRESERVED_LABEL = 0xEF;
private static final List<MplsLabel> ENTIRE_MPLS_LABELS = getEntireMplsLabels();
private static final int TOTAL_ODU2_TRIBUTARY_SLOTS = 8;
@@ -264,8 +268,7 @@
}
private static List<MplsLabel> getEntireMplsLabels() {
- // potentially many objects are created
- return IntStream.range(0, MAX_MPLS_LABEL)
+ return IntStream.range(MIN_UNRESERVED_LABEL, MAX_UNRESERVED_LABEL + 1)
.mapToObj(MplsLabel::mplsLabel)
.collect(Collectors.toList());
}