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:
@@ -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);
|
||||
|
Reference in New Issue
Block a user