rconn: Make rconn_connect() a 'void' function.
[openvswitch] / ofproto / ofproto-sflow.c
index 22d99eb7cf87797a3f0ee39a8f3a1a6dbb284b4e..37c1bb7f457a7ec0da1cab05a43bb15dc8cbe94f 100644 (file)
@@ -239,9 +239,6 @@ success:
 void
 ofproto_sflow_clear(struct ofproto_sflow *os)
 {
-    struct ofproto_sflow_port *osp;
-    unsigned int odp_port;
-
     if (os->sflow_agent) {
         sfl_agent_release(os->sflow_agent);
         os->sflow_agent = NULL;
@@ -251,11 +248,6 @@ ofproto_sflow_clear(struct ofproto_sflow *os)
     ofproto_sflow_options_destroy(os->options);
     os->options = NULL;
 
-    PORT_ARRAY_FOR_EACH (osp, &os->ports, odp_port) {
-        ofproto_sflow_del_port(os, odp_port);
-    }
-    port_array_clear(&os->ports);
-
     /* Turn off sampling to save CPU cycles. */
     dpif_set_sflow_probability(os->dpif, 0);
 }
@@ -282,7 +274,13 @@ void
 ofproto_sflow_destroy(struct ofproto_sflow *os)
 {
     if (os) {
+        struct ofproto_sflow_port *osp;
+        unsigned int odp_port;
+
         ofproto_sflow_clear(os);
+        PORT_ARRAY_FOR_EACH (osp, &os->ports, odp_port) {
+            ofproto_sflow_del_port(os, odp_port);
+        }
         port_array_destroy(&os->ports);
         free(os);
     }
@@ -609,6 +607,6 @@ void
 ofproto_sflow_wait(struct ofproto_sflow *os)
 {
     if (ofproto_sflow_is_enabled(os)) {
-        poll_timer_wait(os->next_tick * 1000 - time_msec());
+        poll_timer_wait_until(os->next_tick * 1000LL);
     }
 }