bridge: Destroy ofproto before deleting dpif.
authorBen Pfaff <blp@nicira.com>
Thu, 31 Mar 2011 21:12:57 +0000 (14:12 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 31 Mar 2011 21:28:42 +0000 (14:28 -0700)
Otherwise the ofproto's attempt to flush flows from the dpif will fail with
an error, causing a spurious log message.

vswitchd/bridge.c

index bf89778..72091a2 100644 (file)
@@ -1690,13 +1690,13 @@ bridge_destroy(struct bridge *br)
             port_destroy(port);
         }
         list_remove(&br->node);
+        ofproto_destroy(br->ofproto);
         error = dpif_delete(br->dpif);
         if (error && error != ENOENT) {
             VLOG_ERR("failed to delete %s: %s",
                      dpif_name(br->dpif), strerror(error));
         }
         dpif_close(br->dpif);
-        ofproto_destroy(br->ofproto);
         mac_learning_destroy(br->ml);
         hmap_destroy(&br->ifaces);
         hmap_destroy(&br->ports);