Priyanka B
Committed by Gerrit Code Review

[ONOS} CR-Resilency fix

Change-Id: I686092b055efa28e9a9fe922d7e46a9d3c51fee0
......@@ -269,7 +269,6 @@ public final class BasicPceccHandler {
* @param tunnel tunnel between ingress to egress
*/
public void releaseLabel(Tunnel tunnel) {
boolean isLastLabelToPush = false;
checkNotNull(labelRsrcService, LABEL_RESOURCE_SERVICE_NULL);
checkNotNull(pceStore, PCE_STORE_NULL);
......@@ -287,19 +286,14 @@ public final class BasicPceccHandler {
PortNumber inPort = lspLocalLabelInfo.inPort();
PortNumber outPort = lspLocalLabelInfo.outPort();
// Check whether this is last link label to push
if (!iterator.hasNext()) {
isLastLabelToPush = true;
}
// Push into device
if ((inLabelId != null) && (inPort != null)) {
installLocalLabelRule(deviceId, inLabelId, inPort, tunnel.tunnelId(), isLastLabelToPush,
installLocalLabelRule(deviceId, inLabelId, inPort, tunnel.tunnelId(), false,
Long.valueOf(LabelType.IN_LABEL.value), Objective.Operation.REMOVE);
}
if ((outLabelId != null) && (outPort != null)) {
installLocalLabelRule(deviceId, outLabelId, outPort, tunnel.tunnelId(), isLastLabelToPush,
installLocalLabelRule(deviceId, outLabelId, outPort, tunnel.tunnelId(), false,
Long.valueOf(LabelType.OUT_LABEL.value), Objective.Operation.REMOVE);
}
......
......@@ -778,7 +778,7 @@ public class PceManager implements PceService {
bwToAllocate = 0;
if ((shBwConstraint != null) && (shBwConstraint.links().contains(link))) {
if (additionalBwValue != null) {
bwToAllocate = bandwidthConstraint - additionalBwValue;
bwToAllocate = additionalBwValue;
}
} else {
bwToAllocate = bandwidthConstraint;
......
......@@ -279,7 +279,7 @@ public class PcepLabelUpdateVer1 implements PcepLabelUpdate {
}
llLabelList = labelDownload.getLabelList();
if (llLabelList == null) {
if (llLabelList == null || llLabelList.isEmpty()) {
throw new PcepParseException("Label list is mandatory object for Label Download.");
} else {
ListIterator<PcepLabelObject> listIterator = llLabelList.listIterator();
......
......@@ -499,7 +499,7 @@ public class BgpcepFlowRuleProvider extends AbstractProvider
*/
if (!deviceId.equals(tunnel.path().src().deviceId()) && !deviceId.equals(tunnel.path().dst().deviceId())) {
//Device is transit node
if (labelType == IN_LABEL_TYPE) {
if (labelType == OUT_LABEL_TYPE) {
//Store label object having IN label value
this.labelObj = labelObj;
return;
......