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

ofp-util: Report OFPMMFC_BAD_FLAGS for bad band flags.

It doesn't make sense to specify both kbps and pkt/s, because the two units
are mutually exclusive.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
This commit is contained in:
Ben Pfaff
2013-11-04 22:36:28 -08:00
parent 142cdb018d
commit 13b1febe4f
2 changed files with 14 additions and 0 deletions

View File

@@ -1746,6 +1746,10 @@ ofputil_decode_meter_mod(const struct ofp_header *oh,
enum ofperr error;
mm->meter.flags = ntohs(omm->flags);
if (mm->meter.flags & OFPMF13_KBPS &&
mm->meter.flags & OFPMF13_PKTPS) {
return OFPERR_OFPMMFC_BAD_FLAGS;
}
mm->meter.bands = bands->data;
error = ofputil_pull_bands(&b, b.size, &mm->meter.n_bands, bands);