I came close to add a "continue;" inside the main "while" loop in
compose_mirror_dsts(), which would have turned it into an infinite loop.
This commit changes it to a "for" loop that is harder to screw up.
---
 ofproto/ofproto-dpif.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index a568ea9..af94d54 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -4654,7 +4654,7 @@ compose_mirror_dsts(struct action_xlate_ctx *ctx,
     }
 
     flow_vid = vlan_tci_to_vid(ctx->flow.vlan_tci);
-    while (mirrors) {
+    for (; mirrors; mirrors &= mirrors - 1) {
         struct ofmirror *m = ofproto->mirrors[mirror_mask_ffs(mirrors) - 1];
         if (vlan_is_mirrored(m, vlan)) {
             struct dst dst;
@@ -4689,7 +4689,6 @@ compose_mirror_dsts(struct action_xlate_ctx *ctx,
                 }
             }
         }
-        mirrors &= mirrors - 1;
     }
 }
 
-- 
1.7.2.5

_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev

Reply via email to