ofp-util: Do not allow buckets for OFPGC15_REMOVE_BUCKET.
authorSimon Horman <simon.horman@netronome.com>
Wed, 12 Nov 2014 06:24:08 +0000 (15:24 +0900)
committerBen Pfaff <blp@nicira.com>
Wed, 12 Nov 2014 17:06:49 +0000 (09:06 -0800)
ONF-JIRA: EXT-350
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/ofp-util.c

index 496dc40..f1431d5 100644 (file)
@@ -7973,6 +7973,21 @@ ofputil_decode_group_mod(const struct ofp_header *oh,
         OVS_NOT_REACHED();
     }
 
+    switch (gm->command) {
+    case OFPGC11_ADD:
+    case OFPGC11_MODIFY:
+    case OFPGC11_DELETE:
+    case OFPGC15_INSERT_BUCKET:
+        break;
+    case OFPGC15_REMOVE_BUCKET:
+        if (!list_is_empty(&gm->buckets)) {
+            return OFPERR_OFPGMFC_BAD_BUCKET;
+        }
+        break;
+    default:
+        OVS_NOT_REACHED();
+    }
+
     LIST_FOR_EACH (bucket, list_node, &gm->buckets) {
         switch (gm->type) {
         case OFPGT11_ALL: