Fix for runtime creation of groups in driver
diff --git a/src/main/java/net/onrc/onos/core/drivermanager/OFSwitchImplCPqD13.java b/src/main/java/net/onrc/onos/core/drivermanager/OFSwitchImplCPqD13.java
index 8ebe8cc..f2a65a7 100644
--- a/src/main/java/net/onrc/onos/core/drivermanager/OFSwitchImplCPqD13.java
+++ b/src/main/java/net/onrc/onos/core/drivermanager/OFSwitchImplCPqD13.java
@@ -1147,16 +1147,16 @@
} else if (action instanceof GroupAction) {
NeighborSet ns = ((GroupAction) action).getDpids();
EcmpInfo ei = ecmpGroups.get(ns);
- if (ei != null) {
- int gid = ei.groupId;
- ofAction = factory.actions().buildGroup()
- .setGroup(OFGroup.of(gid))
- .build();
- } else {
+ if (ei == null) {
log.debug("Unable to find ecmp group for neighbors {} at "
+ "switch {} and hence creating it", ns, getStringId());
createGroupForANeighborSet(ns, groupid.incrementAndGet());
+ ei = ecmpGroups.get(ns);
}
+ int gid = ei.groupId;
+ ofAction = factory.actions().buildGroup()
+ .setGroup(OFGroup.of(gid))
+ .build();
} else if (action instanceof DecNwTtlAction) {
ofAction = factory.actions().decNwTtl();
} else if (action instanceof DecMplsTtlAction) {