summaryrefslogtreecommitdiff
path: root/ofproto/ofproto-provider.h
diff options
context:
space:
mode:
authorBen Pfaff <blp@ovn.org>2018-01-26 11:43:27 -0800
committerBen Pfaff <blp@ovn.org>2018-01-26 11:43:27 -0800
commit6399df6a88264a61811d377553dcac56736c6bed (patch)
tree268cabbafb6fd9e6985e13ef095c37a0b330468b /ofproto/ofproto-provider.h
parent7c3f0e2992c89a65d93782fe0689677bb42465d5 (diff)
downloadopenvswitch-6399df6a88264a61811d377553dcac56736c6bed.tar.gz
ofproto: Fix double-unref of temporary rule when learning.
When ofproto_flow_mod_init() accepts a rule, it takes ownership of it and either unrefs it on error or transfers ownership to the struct it initializes on success, but ofproto_flow_mod_init_for_learn() was unref-ing it a second time if it reported an error. Signed-off-by: Ben Pfaff <blp@ovn.org> Acked-by: William Tu <u9012063@gmail.com>
Diffstat (limited to 'ofproto/ofproto-provider.h')
-rw-r--r--ofproto/ofproto-provider.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/ofproto/ofproto-provider.h b/ofproto/ofproto-provider.h
index 9dc73c482..ae4af4525 100644
--- a/ofproto/ofproto-provider.h
+++ b/ofproto/ofproto-provider.h
@@ -1874,7 +1874,10 @@ struct rule_criteria {
/* flow_mod with execution context. */
struct ofproto_flow_mod {
/* Allocated by 'init' phase, may be freed after 'start' phase, as these
- * are not needed for 'revert' nor 'finish'. */
+ * are not needed for 'revert' nor 'finish'.
+ *
+ * This structure owns a reference to 'temp_rule' (if it is nonnull) that
+ * must be eventually be released with ofproto_rule_unref(). */
struct rule *temp_rule;
struct rule_criteria criteria;
struct cls_conjunction *conjs;