Added equals and hashCode to the Interface class
diff --git a/src/main/java/net/onrc/onos/ofcontroller/bgproute/BgpRoute.java b/src/main/java/net/onrc/onos/ofcontroller/bgproute/BgpRoute.java
index 0e53c02..97b3a68 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/bgproute/BgpRoute.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/bgproute/BgpRoute.java
@@ -493,7 +493,7 @@
Map<Long, Interface> srcInterfaces = new HashMap<Long, Interface>();
for (Interface intf : interfaces.values()) {
if (!srcInterfaces.containsKey(intf.getDpid())
- && intf != egressInterface) {
+ && !intf.equals(egressInterface)) {
srcInterfaces.put(intf.getDpid(), intf);
}
}
@@ -695,7 +695,7 @@
List<PushedFlowMod> pushedFlows = new ArrayList<PushedFlowMod>();
for (Interface srcInterface : interfaces.values()) {
- if (dstInterface.getName().equals(srcInterface.getName())){
+ if (dstInterface.equals(srcInterface)){
continue;
}
@@ -1085,7 +1085,7 @@
private void checkTopologyReady(){
for (Interface dstInterface : interfaces.values()) {
for (Interface srcInterface : interfaces.values()) {
- if (dstInterface == srcInterface) {
+ if (dstInterface.equals(srcInterface)) {
continue;
}