ofproto-dpif: Fix bad pointer dereference when deleting a bridge.
authorBen Pfaff <blp@nicira.com>
Fri, 16 Aug 2013 00:54:04 +0000 (17:54 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 16 Aug 2013 01:00:22 +0000 (18:00 -0700)
The 'pins' list contains packet-ins, not flow-mods.

Introduced by commit ada3a58d1f8 (ofproto-dpif: Make packet_ins thread
safe.).

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
ofproto/ofproto-dpif.c

index 4e953f4..0b7df80 100644 (file)
@@ -1418,7 +1418,7 @@ destruct(struct ofproto *ofproto_)
 {
     struct ofproto_dpif *ofproto = ofproto_dpif_cast(ofproto_);
     struct rule_dpif *rule, *next_rule;
-    struct ofputil_flow_mod *pin, *next_pin;
+    struct ofputil_packet_in *pin, *next_pin;
     struct ofputil_flow_mod *fm, *next_fm;
     struct oftable *table;
 
@@ -1455,7 +1455,7 @@ destruct(struct ofproto *ofproto_)
     LIST_FOR_EACH_SAFE (pin, next_pin, list_node, &ofproto->pins) {
         list_remove(&pin->list_node);
         ofproto->n_pins--;
-        free(pin->ofpacts);
+        free(CONST_CAST(void *, pin->packet));
         free(pin);
     }
     ovs_mutex_unlock(&ofproto->pin_mutex);