[ovs-dev] [PATCH] ofproto: Factor conditional out of loop in send_flow_removed().

Ben Pfaff blp at nicira.com
Thu Oct 7 10:33:32 PDT 2010


---
I'm going to push this out in a few minutes as obvious.  Comments
welcome.

diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 6de30b3..ed7f5b0 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -4466,6 +4466,10 @@ send_flow_removed(struct ofproto *p, struct rule *rule,
     struct ofconn *prev;
     struct ofpbuf *buf = NULL;
 
+    if (!rule->send_flow_removed) {
+        return;
+    }
+
     /* We limit the maximum number of queued flow expirations it by accounting
      * them under the counter for replies.  That works because preventing
      * OpenFlow requests from being processed also prevents new flows from
@@ -4474,7 +4478,7 @@ send_flow_removed(struct ofproto *p, struct rule *rule,
 
     prev = NULL;
     LIST_FOR_EACH (ofconn, node, &p->all_conns) {
-        if (rule->send_flow_removed && rconn_is_connected(ofconn->rconn)
+        if (rconn_is_connected(ofconn->rconn)
             && ofconn_receives_async_msgs(ofconn)) {
             if (prev) {
                 queue_tx(ofpbuf_clone(buf), prev, prev->reply_counter);
-- 
1.7.1





More information about the dev mailing list