summaryrefslogtreecommitdiff
path: root/ofproto/ofproto.c
diff options
context:
space:
mode:
authorLi Wei <liwei.solomon@gmail.com>2019-03-20 20:16:18 +0800
committerBen Pfaff <blp@ovn.org>2019-03-25 13:32:22 -0700
commit304c8075c24d401e9497922d8c5438c48d0b90d7 (patch)
tree86948b7744a50fd39473c55f8a006ef3d1e1633a /ofproto/ofproto.c
parent170ef7265a36b3716b1bdc6fd067e9dd7f38a133 (diff)
downloadopenvswitch-304c8075c24d401e9497922d8c5438c48d0b90d7.tar.gz
ofproto: fix the bug of bucket counter is not updated
After inserting/removing a bucket, we don't update the bucket counter. When we call ovs-ofctl dump-group-stats br-int, a panic happened. Reproduce steps: 1. ovs-ofctl -O OpenFlow15 add-group br-int "group_id=1, type=select, selection_method=hash bucket=bucket_id=1,weight:100,actions=output:1" 2. ovs-ofctl insert-buckets br-int "group_id=1, command_bucket_id=last, bucket=bucket_id=7,weight:800,actions=output:1" 3. ovs-ofctl dump-group-stats br-int gdb) bt at ../sysdeps/posix/libc_fatal.c:175 ar_ptr=<optimized out>) at malloc.c:5049 group_id=<optimized out>, cb=cb@entry=0x55cab8fd6cd0 <append_group_stats>) at ofproto/ofproto.c:6790 Signed-off-by: solomon <liwei.solomon@gmail.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ofproto/ofproto.c')
-rw-r--r--ofproto/ofproto.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index 40780e276..453239df2 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -7425,6 +7425,8 @@ modify_group_start(struct ofproto *ofproto, struct ofproto_group_mod *ogm)
*CONST_CAST(long long int *, &(new_group->created)) = old_group->created;
*CONST_CAST(long long int *, &(new_group->modified)) = time_msec();
+ *CONST_CAST(uint32_t *, &(new_group->n_buckets)) =
+ ovs_list_size(&(new_group->buckets));
group_collection_add(&ogm->old_groups, old_group);
/* Mark the old group for deletion. */