heisenberg
Committed by Gerrit Code Review

[ONOS-4476]As with Group type is FAILOVER,watchPort&watchGroup does not set corr…

…ectly When builds the Group Modification Openflow message

Change-Id: I344e3b03cd18e16f4e30ceb5b67ce9e55e871876
......@@ -194,8 +194,17 @@ public final class GroupModBuilder {
if (type == GroupDescription.Type.SELECT) {
bucketBuilder.setWeight(1);
}
bucketBuilder.setWatchGroup(OFGroup.ANY);
bucketBuilder.setWatchPort(OFPort.ANY);
if (type == GroupDescription.Type.FAILOVER && bucket.watchPort() != null) {
bucketBuilder.setWatchPort(OFPort.of((int) bucket.watchPort().toLong()));
} else {
bucketBuilder.setWatchPort(OFPort.ANY);
}
if (type == GroupDescription.Type.FAILOVER && bucket.watchGroup() != null) {
bucketBuilder.setWatchGroup(OFGroup.of(bucket.watchGroup().id()));
} else {
bucketBuilder.setWatchGroup(OFGroup.ANY);
}
OFBucket ofBucket = bucketBuilder.build();
ofBuckets.add(ofBucket);
}
......