Have openflow switch report all flow removals
[controller.git] / opendaylight / protocol_plugins / openflow / src / main / java / org / opendaylight / controller / protocol_plugin / openflow / internal / FlowConverter.java
index daf1aa8b7168a8b3a4670f21d0468036e42a380f..2bbe9c12c6719e736f960bd2fba4a1457825060c 100644 (file)
@@ -451,13 +451,10 @@ public class FlowConverter {
             if (port != null) {
                 ((OFFlowMod) fm).setOutPort(port);
             }
-            if (command == OFFlowMod.OFPFC_ADD
-                    || command == OFFlowMod.OFPFC_MODIFY
+            if (command == OFFlowMod.OFPFC_ADD || command == OFFlowMod.OFPFC_MODIFY
                     || command == OFFlowMod.OFPFC_MODIFY_STRICT) {
-                if (flow.getIdleTimeout() != 0 || flow.getHardTimeout() != 0) {
-                    // Instruct switch to let controller know when flow expires
-                    ((OFFlowMod) fm).setFlags((short) 1);
-                }
+                // Instruct switch to let controller know when flow is removed
+                ((OFFlowMod) fm).setFlags((short) 1);
             }
         } else {
             ((V6FlowMod) fm).setVendor();
@@ -475,13 +472,10 @@ public class FlowConverter {
             if (port != null) {
                 ((V6FlowMod) fm).setOutPort(port);
             }
-            if (command == OFFlowMod.OFPFC_ADD
-                    || command == OFFlowMod.OFPFC_MODIFY
+            if (command == OFFlowMod.OFPFC_ADD || command == OFFlowMod.OFPFC_MODIFY
                     || command == OFFlowMod.OFPFC_MODIFY_STRICT) {
-                if (flow.getIdleTimeout() != 0 || flow.getHardTimeout() != 0) {
-                    // Instruct switch to let controller know when flow expires
-                    ((V6FlowMod) fm).setFlags((short) 1);
-                }
+                // Instruct switch to let controller know when flow is removed
+                ((V6FlowMod) fm).setFlags((short) 1);
             }
         }
         logger.trace("Openflow Match: {} Openflow Actions: {}", ofMatch,