Skip to content

Commit

Permalink
ofp-util: return BAD_TYPE for consistency at ofputil_decode_group_mod().
Browse files Browse the repository at this point in the history
Code earlier in this function validated that gm->type is valid, so
the default case at the end of the function would be impossible, but
since the code can change or perhaps get copied, return the correct
error to keep consistency and avoid reintroducing the bug fixed by
commit 09d4b95 ("ofp-util: Reject bad group type and command
with error instead of abort.")

Signed-off-by: Flavio Leitner <fbl@redhat.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
  • Loading branch information
fleitner authored and blp committed Dec 23, 2015
1 parent 3f32cfe commit 896313f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/ofp-util.c
Expand Up @@ -8880,7 +8880,9 @@ ofputil_decode_group_mod(const struct ofp_header *oh,
}
break;
default:
OVS_NOT_REACHED();
/* Returning BAD TYPE to be consistent
* though gm->type has been checked already. */
return OFPERR_OFPGMFC_BAD_TYPE;
}
}

Expand Down

0 comments on commit 896313f

Please sign in to comment.