[ovs-dev] [PATCH] ofproto: Fix statistics of removed flow.

Roi Dayan roid at mellanox.com
Thu May 14 19:43:59 UTC 2020



On 2020-05-14 9:33 PM, Ilya Maximets wrote:
> 'fr' is a new variable on the stack.  '+=' here adds the real statistics
> to a random stack memory.
> 
> Fixes: 164413156cf9 ("Add offload packets statistics")
> Signed-off-by: Ilya Maximets <i.maximets at ovn.org>
> ---
>  ofproto/ofproto.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
> index 0fbd6c380..59f06aa94 100644
> --- a/ofproto/ofproto.c
> +++ b/ofproto/ofproto.c
> @@ -6085,8 +6085,8 @@ ofproto_rule_send_removed(struct rule *rule)
>      fr.hard_timeout = rule->hard_timeout;
>      ovs_mutex_unlock(&rule->mutex);
>      rule->ofproto->ofproto_class->rule_get_stats(rule, &stats, &used);
> -    fr.packet_count += stats.n_packets;
> -    fr.byte_count += stats.n_bytes;
> +    fr.packet_count = stats.n_packets;
> +    fr.byte_count = stats.n_bytes;
>      connmgr_send_flow_removed(connmgr, &fr);
>      ovs_mutex_unlock(&ofproto_mutex);
>  }
> 

Acked-by: Roi Dayan <roid at mellanox.com>


More information about the dev mailing list