X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fdpif-netdev.c;fp=lib%2Fdpif-netdev.c;h=b1c25c82b30d2fe092a812d5503ba94faec46414;hb=db19b72b9f6d0d40b743214241d9666116e3b448;hp=b3a37426078a04082ff24c90a601dcd9f58b7608;hpb=5de43a606c949dbb74272d5b09627ddd5f64b06b;p=sliver-openvswitch.git diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index b3a374260..b1c25c82b 100644 --- a/lib/dpif-netdev.c +++ b/lib/dpif-netdev.c @@ -879,6 +879,7 @@ dp_netdev_flow_unref(struct dp_netdev_flow *flow) cls_rule_destroy(CONST_CAST(struct cls_rule *, &flow->cr)); ovs_mutex_lock(&flow->mutex); dp_netdev_actions_unref(flow->actions); + ovs_refcount_destroy(&flow->ref_cnt); ovs_mutex_unlock(&flow->mutex); ovs_mutex_destroy(&flow->mutex); free(flow); @@ -1302,6 +1303,7 @@ dpif_netdev_flow_del(struct dpif *dpif, const struct dpif_flow_del *del) ovs_mutex_unlock(&netdev_flow->mutex); } dp_netdev_remove_flow(dp, netdev_flow); + dp_netdev_flow_unref(netdev_flow); } else { error = ENOENT; } @@ -1551,6 +1553,7 @@ void dp_netdev_actions_unref(struct dp_netdev_actions *actions) { if (actions && ovs_refcount_unref(&actions->ref_cnt) == 1) { + ovs_refcount_destroy(&actions->ref_cnt); free(actions->actions); free(actions); } @@ -1712,6 +1715,7 @@ dp_netdev_port_input(struct dp_netdev *dp, struct ofpbuf *packet, dp_netdev_execute_actions(dp, &key, packet, md, actions->actions, actions->size); dp_netdev_actions_unref(actions); + dp_netdev_flow_unref(netdev_flow); ovsthread_counter_inc(dp->n_hit, 1); } else { ovsthread_counter_inc(dp->n_missed, 1);