This seems cleaner to me: it seems risky to "clear" something that has not
been initialized yet. It's also a super-minor optimization, I suppose.
}
}
+/* Initializes a new 'nf_flow' given that the caller has already cleared it to
+ * all-zero-bits. */
+void
+netflow_flow_init(struct netflow_flow *nf_flow OVS_UNUSED)
+{
+ /* Nothing to do. */
+}
+
void
netflow_flow_clear(struct netflow_flow *nf_flow)
{
struct ofexpired *);
void netflow_run(struct netflow *);
+void netflow_flow_init(struct netflow_flow *);
void netflow_flow_clear(struct netflow_flow *);
void netflow_flow_update_time(struct netflow *, struct netflow_flow *,
long long int used);
rule->n_actions = n_actions;
rule->actions = xmemdup(actions, n_actions * sizeof *actions);
}
- netflow_flow_clear(&rule->nf_flow);
+ netflow_flow_init(&rule->nf_flow);
netflow_flow_update_time(ofproto->netflow, &rule->nf_flow, rule->created);
return rule;