On Tue, Jul 28, 2015 at 03:21:14PM -0700, Ben Pfaff wrote:
> This complies with OpenFlow 1.1 and later.
> 
> Found by OFTest.

OF1.1 specs says on page 42 that weight is only defined for
select groups.

and on page 23 says that switch must refuse to add the group
entry and must send an error msg with code OFPGMFC_INVALID_GROUP.

Based on that, the patch looks correct to me.

Acked-by: Flavio Leitner <f...@sysclose.org>


> 
> Signed-off-by: Ben Pfaff <b...@nicira.com>
> ---
>  lib/ofp-util.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/lib/ofp-util.c b/lib/ofp-util.c
> index 9996e84..28f6d8f 100644
> --- a/lib/ofp-util.c
> +++ b/lib/ofp-util.c
> @@ -8592,6 +8592,10 @@ ofputil_decode_group_mod(const struct ofp_header *oh,
>      }
>  
>      LIST_FOR_EACH (bucket, list_node, &gm->buckets) {
> +        if (bucket->weight && gm->type != OFPGT11_SELECT) {
> +            return OFPERR_OFPGMFC_INVALID_GROUP;
> +        }
> +
>          switch (gm->type) {
>          case OFPGT11_ALL:
>          case OFPGT11_INDIRECT:
> -- 
> 2.1.3
> 
> _______________________________________________
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to