Fixes crash introduced in 9ba15e (ofproto-dpif: Improve RSPAN
translation performance from O(n**2) to O(n).)  The code always
dereferenced the members of the "mirrors" array in ofproto even if they
were null.
---
 ofproto/ofproto-dpif.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index 86723e1..3e92493 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -1682,7 +1682,7 @@ mirror_update_dups(struct ofproto_dpif *ofproto)
         for (j = i + 1; j < MAX_MIRRORS; j++) {
             struct ofmirror *m2 = ofproto->mirrors[j];
 
-            if (m1->out == m2->out && m1->out_vlan == m2->out_vlan) {
+            if (m2 && m1->out == m2->out && m1->out_vlan == m2->out_vlan) {
                 m1->dup_mirrors |= MIRROR_MASK_C(1) << j;
                 m2->dup_mirrors |= m1->dup_mirrors;
             }
-- 
1.7.4.1

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to