A group can have no buckets, in which case ovs_list_back() assert-fails.
This fixes the problem.
Found by OFTest.
Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=
1626488
Tested-by: Eelco Chaudron <echaudro@redhat.com>
Fixes: a04e58881e25 ("ofproto-dpif-xlate: Simplify translation for groups.")
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Eelco Chaudron <echaudro@redhat.com>
bool is_last_action)
{
if (group->up.type == OFPGT11_ALL || group->up.type == OFPGT11_INDIRECT) {
- struct ovs_list *last_bucket = ovs_list_back(&group->up.buckets);
+ struct ovs_list *last_bucket = group->up.buckets.prev;
struct ofputil_bucket *bucket;
LIST_FOR_EACH (bucket, list_node, &group->up.buckets) {
bool is_last_bucket = &bucket->list_node == last_bucket;