2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +00:00

meta-flow: Make mf_vl_mff_mf_from_nxm_header() require a valid field.

All the users of mf_vl_mff_mf_from_nxm_header() expect it to always obtain
a valid field or to report an error.  In practice, it did not report an
error in the case where the field was unknown (although it did report an
error in some other cases).  This commit fixes the problem.

Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9652
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Alin Gabriel Serdean <aserdean@ovn.org>
This commit is contained in:
Ben Pfaff
2018-07-31 14:51:54 -07:00
parent 6c8dd8caaf
commit c5358a967a

View File

@@ -3519,7 +3519,9 @@ mf_vl_mff_mf_from_nxm_header(uint32_t header,
uint64_t *tlv_bitmap)
{
*field = mf_from_nxm_header(header, vl_mff_map);
if (mf_vl_mff_invalid(*field, vl_mff_map)) {
if (!*field) {
return OFPERR_OFPBAC_BAD_SET_TYPE;
} else if (mf_vl_mff_invalid(*field, vl_mff_map)) {
return OFPERR_NXFMFC_INVALID_TLV_FIELD;
}