From: Simon Horman Date: Wed, 12 Nov 2014 06:24:08 +0000 (+0900) Subject: ofp-util: Do not allow buckets for OFPGC15_REMOVE_BUCKET. X-Git-Tag: v2.4.0~965 X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=65075b99a72b88e4c4d6f991496a9e824aa87479;hp=80ee73d35ef187f32216ae67500e776dcaafbad1;p=cascardo%2Fovs.git ofp-util: Do not allow buckets for OFPGC15_REMOVE_BUCKET. ONF-JIRA: EXT-350 Signed-off-by: Simon Horman Signed-off-by: Ben Pfaff --- diff --git a/lib/ofp-util.c b/lib/ofp-util.c index 496dc404e..f1431d54f 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -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: