2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

ofproto: Only allow indirect groups with one bucket

OpenFlow 1.1 - 1.4 specify that indirect groups should
opperate on the "one defined bucket in the group". OpenFlow
1.2 - 1.4 also state "This group only supports a single bucket."

This patch enforces the single bucket limitation for indirect groups
when decoding group mod messages. A test is also added to exercise
this change.

Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Simon Horman
2014-10-24 14:59:20 +09:00
committed by Ben Pfaff
parent 68501cfc25
commit e1799eb718
2 changed files with 30 additions and 0 deletions

View File

@@ -7420,6 +7420,20 @@ ofputil_decode_group_mod(const struct ofp_header *oh,
return err;
}
switch (gm->type) {
case OFPGT11_INDIRECT:
if (!list_is_singleton(&gm->buckets)) {
return OFPERR_OFPGMFC_INVALID_GROUP;
}
break;
case OFPGT11_ALL:
case OFPGT11_SELECT:
case OFPGT11_FF:
break;
default:
OVS_NOT_REACHED();
}
LIST_FOR_EACH (bucket, list_node, &gm->buckets) {
switch (gm->type) {
case OFPGT11_ALL: