]> git.proxmox.com Git - mirror_ovs.git/commitdiff
ofproto-dpif-xlate: Fix translation of groups with no buckets.
authorBen Pfaff <blp@ovn.org>
Sun, 2 Sep 2018 16:30:43 +0000 (09:30 -0700)
committerBen Pfaff <blp@ovn.org>
Tue, 18 Sep 2018 04:41:00 +0000 (21:41 -0700)
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>
ofproto/ofproto-dpif-xlate.c

index e26f6c8f554af166997eb218c0d03c2902be549e..507e14dd0d0025bb5f1bd18779c5cef0ddcab92d 100644 (file)
@@ -4488,7 +4488,7 @@ xlate_group_action__(struct xlate_ctx *ctx, struct group_dpif *group,
                      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;