diff options
author | Ben Pfaff <blp@ovn.org> | 2018-07-05 15:28:51 -0700 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2018-07-06 17:51:14 -0700 |
commit | 94b443070fea2a15bc4768c35d59d46892cdc901 (patch) | |
tree | 24bb3a1c7ad119a32c583abb310bf7c3e49c36f7 | |
parent | 2178af6ff4f36db036dd6de23af3fd3bfaefea34 (diff) | |
download | openvswitch-94b443070fea2a15bc4768c35d59d46892cdc901.tar.gz |
ofp-group: Don't assert-fail decoding bad OF1.5 group mod type or command.
When decoding a group mod, the current code validates the group type and
command after the whole group mod has been decoded. The OF1.5 decoder,
however, tries to use the type and command earlier, when it might still be
invalid. This caused an assertion failure (via OVS_NOT_REACHED). This
commit fixes the problem.
ovs-vswitchd does not enable support for OpenFlow 1.5 by default.
Reported-at: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9249
Signed-off-by: Ben Pfaff <blp@ovn.org>
Reviewed-by: Yifeng Sun <pkusunyifeng@gmail.com>
-rw-r--r-- | lib/ofp-util.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ofp-util.c b/lib/ofp-util.c index 90c0a0ffe..c5a551546 100644 --- a/lib/ofp-util.c +++ b/lib/ofp-util.c @@ -8280,7 +8280,7 @@ parse_group_prop_ntr_selection_method(struct ofpbuf *payload, "for select groups"); return OFPERR_OFPBPC_BAD_VALUE; default: - OVS_NOT_REACHED(); + return OFPERR_OFPGMFC_BAD_TYPE; } switch (group_cmd) { @@ -8294,7 +8294,7 @@ parse_group_prop_ntr_selection_method(struct ofpbuf *payload, "for add and delete group modifications"); return OFPERR_OFPBPC_BAD_VALUE; default: - OVS_NOT_REACHED(); + return OFPERR_OFPGMFC_BAD_COMMAND; } if (payload->size < sizeof *prop) { |