Priyanka B
Committed by Gerrit Code Review

[ONOS] RSVP defect fix

Change-Id: I7ac7a9f9dd806949d900743a3978eec34ab4a3fb
......@@ -86,10 +86,9 @@ public class PceSetupPathCommand extends AbstractShellCommand {
LspType lspType = LspType.values()[type];
// Add bandwidth
// bandwidth default data rate unit is in MBPS, since bandwidth value in network config
//stored in MPBS
// bandwidth default data rate unit is in BPS
if (bandwidth != 0.0) {
listConstrnt.add(BandwidthConstraint.of(bandwidth, DataRateUnit.valueOf("MBPS")));
listConstrnt.add(BandwidthConstraint.of(bandwidth, DataRateUnit.valueOf("BPS")));
}
// Add cost
......
......@@ -515,7 +515,14 @@ public class PceManager implements PceService {
}
if (existingBwValue != null) {
shBwConstraint = new SharedBandwidthConstraint(links, existingBwValue, bwConstraint.bandwidth());
if (bwConstraintValue == 0) {
bwConstraintValue = existingBwValue.bps();
}
//If bandwidth constraints not specified , take existing bandwidth for shared bandwidth calculation
shBwConstraint = bwConstraint != null ? new SharedBandwidthConstraint(links,
existingBwValue, bwConstraint.bandwidth()) : new SharedBandwidthConstraint(links,
existingBwValue, existingBwValue);
constraints.add(shBwConstraint);
}
} else {
......
......@@ -72,7 +72,7 @@ public class PcepClientImpl implements PcepClientDriver {
private byte deadTime;
private byte sessionId;
private PcepPacketStatsImpl pktStats;
private Map<LspKey, Boolean> lspDelegationInfo;
private Map<LspKey, Boolean> lspDelegationInfo = new HashMap<>();
private Map<PccId, List<PcepStateReport>> syncRptCache = new HashMap<>();
@Override
......