vconn: Fix endian issue in unknown action type error message
[openvswitch] / lib / dpif.c
index 14b424e65c3948a993c2bc0a36d41c0c4d8896ef..649c2464c8aae38a11a3f0e7f23ab10640ad448f 100644 (file)
@@ -95,9 +95,9 @@ dp_wait(void)
     }
 }
 
-/* Initializes 'all_dps' and enumerates the names of all known created
- * datapaths, where possible, into it.  Returns 0 if successful, otherwise a
- * positive errno value.
+/* Clears 'all_dps' and enumerates the names of all known created datapaths, 
+ * where possible, into it.  The caller must first initialize 'all_dps'.
+ * Returns 0 if successful, otherwise a positive errno value.
  *
  * Some kinds of datapaths might not be practically enumerable.  This is not
  * considered an error. */
@@ -107,7 +107,7 @@ dp_enumerate(struct svec *all_dps)
     int error;
     int i;
 
-    svec_init(all_dps);
+    svec_clear(all_dps);
     error = 0;
     for (i = 0; i < N_DPIF_CLASSES; i++) {
         const struct dpif_class *class = dpif_classes[i];
@@ -397,7 +397,7 @@ dpif_port_list(const struct dpif *dpif,
                struct odp_port **portsp, size_t *n_portsp)
 {
     struct odp_port *ports;
-    size_t n_ports;
+    size_t n_ports = 0;
     int error;
 
     for (;;) {