[ovs-dev] [PATCH] ofproto: correctly copy active timeout from options

Glen Gibb grg at stanford.edu
Mon Dec 7 02:50:40 UTC 2009


Copy the active timeout from options if the timeout is positive.
Previous code incorrectly copied *negative* values from the options.

Bug originally introduced in commit 76343538 "vswitchd: Initial
conversion to database-based configuration."

Note: patch has *not* been tested.

diff --git a/ofproto/netflow.c b/ofproto/netflow.c
index 2c7ae9e..b016663 100644
--- a/ofproto/netflow.c
+++ b/ofproto/netflow.c
@@ -210,7 +210,7 @@ netflow_set_options(struct netflow *nf,
      collectors_create(&nf_options->collectors, 0, &nf->collectors);

      old_timeout = nf->active_timeout;
-    if (nf_options->active_timeout < 0) {
+    if (nf_options->active_timeout > 0) {
          nf->active_timeout = nf_options->active_timeout;
      } else {
          nf->active_timeout = ACTIVE_TIMEOUT_DEFAULT;





More information about the dev mailing list