api: Do not assert of short message lengths 82/35782/2
authorNeale Ranns <neale@graphiant.com>
Fri, 25 Mar 2022 08:34:53 +0000 (08:34 +0000)
committerNeale Ranns <neale@graphiant.com>
Fri, 8 Apr 2022 12:09:45 +0000 (12:09 +0000)
Type: improvement

Short message lengths are correctly handled by the code, asserting makes unit tests that verify this behaviour (e.g. test_ip_punt_api_validation) fail/crash with a debug image.

Signed-off-by: Neale Ranns <neale@graphiant.com>
Change-Id: Ib3a377e5d49fde0eee252b92f0e58a8a0d0d83ec

src/vlibapi/api_shared.c

index 7727843..17560e5 100644 (file)
@@ -551,7 +551,6 @@ msg_handler_internal (api_main_t *am, void *the_msg, uword msg_len,
       if (calc_size_fp)
        {
          calc_size = (*calc_size_fp) (the_msg);
-         ASSERT (calc_size <= msg_len);
          if (calc_size > msg_len)
            {
              clib_warning (