ofproto: Return correct error codes from meter_set.
This routine should return enum ofperr, but in a couple of places
doesn't. When adding one more meter when the meter table is full,
this results in an incorrect error message.
@@ -5940,11 +5940,11 @@ meter_set(struct ofproto *ofproto_, ofproto_meter_id *meter_id,
/* Provider ID unknown. Use backer to allocate a new DP meter */
if (meter_id->uint32 == UINT32_MAX) {
if (!ofproto->backer->meter_ids) {
- return EFBIG; /* Datapath does not support meter. */
+ return OFPERR_OFPMMFC_OUT_OF_METERS; /* Meters not supported. */
}
if(!id_pool_alloc_id(ofproto->backer->meter_ids, &meter_id->uint32)) {
- return ENOMEM; /* Can't allocate a DP meter. */
+ return OFPERR_OFPMMFC_OUT_OF_METERS; /* Can't allocate meter. */
}
}
