ofp-util: return BAD_TYPE for consistency at ofputil_decode_group_mod().
authorFlavio Leitner <fbl@redhat.com>
Tue, 22 Dec 2015 17:02:31 +0000 (15:02 -0200)
committerBen Pfaff <blp@ovn.org>
Wed, 23 Dec 2015 00:48:57 +0000 (16:48 -0800)
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 09d4b951636b ("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>
lib/ofp-util.c

index d7e9ccc..126b555 100644 (file)
@@ -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;
         }
     }