Avantika-Huawei

Defect fixes (cherry picked from master)

Change-Id: Icba699c84194170143c54e249af6317003ecdfc6
......@@ -286,17 +286,17 @@ public final class BasicPceccHandler {
PortNumber inPort = lspLocalLabelInfo.inPort();
PortNumber outPort = lspLocalLabelInfo.outPort();
if ((outLabelId != null) && (outPort != null)) {
installLocalLabelRule(deviceId, outLabelId, outPort, tunnel.tunnelId(), false,
Long.valueOf(LabelType.OUT_LABEL.value), Objective.Operation.REMOVE);
}
// Push into device
if ((inLabelId != null) && (inPort != null)) {
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(), false,
Long.valueOf(LabelType.OUT_LABEL.value), Objective.Operation.REMOVE);
}
// List is stored from egress to ingress. So, using IN label id to release.
// Only one local label is assigned to device (destination node)
// and that is used as OUT label for source node.
......
......@@ -844,16 +844,17 @@ public class PceManager implements PceService {
}
}
if (isLinkShared) {
releaseSharedBandwidth(newTunnel, tunnel);
return;
}
PceccTunnelInfo tunnelInfo = pceStore.getTunnelInfo(tunnel.tunnelId());
if (tunnelInfo == null || tunnelInfo.tunnelConsumerId() == null) {
//If bandwidth for old tunnel is not allocated i,e 0 then no need to release
return;
}
if (isLinkShared) {
releaseSharedBandwidth(newTunnel, tunnel);
return;
}
resourceService.release(tunnelInfo.tunnelConsumerId());
return;
......
......@@ -479,7 +479,7 @@ public class PcepClientControllerImpl implements PcepClientController {
} else if (pathNameTlv != null) {
tunnel = preSyncLspDbByName.get(Arrays.toString(pathNameTlv.getValue()));
if (tunnel != null) {
preSyncLspDbByName.remove(tunnel.tunnelName());
preSyncLspDbByName.remove(tunnel.tunnelName().value());
}
}
......
......@@ -366,7 +366,6 @@ public class PcepLspObjectVer1 implements PcepLspObject {
default:
// Skip the unknown TLV.
cb.skipBytes(hLength);
tlv = null;
log.info("Received unsupported TLV type :" + hType + " in LSP object.");
}
// Check for the padding
......