fib: fix coverity 253539 04/37004/3
authorAndrew Yourtchenko <ayourtch@gmail.com>
Tue, 23 Aug 2022 17:23:47 +0000 (17:23 +0000)
committerNeale Ranns <neale@graphiant.com>
Mon, 29 Aug 2022 23:52:13 +0000 (23:52 +0000)
Add an ASSERT so coverity is aware of the assumption taken,
without incurring any penalty in release build.

Type: fix
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
Change-Id: I3e7e1e77059492315409efbed47657f9e56d167c
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
src/vnet/dpo/load_balance.c

index 9001a35..ff46d56 100644 (file)
@@ -592,6 +592,7 @@ load_balance_fill_buckets_sticky (load_balance_t *lb,
             {
                 /* fill the bucks from the next up path */
                 load_balance_set_bucket_i(lb, bucket++, buckets, &fwding_paths[fpath].path_dpo);
+                ASSERT(vec_len(fwding_paths) > 0);
                 fpath = (fpath + 1) % vec_len(fwding_paths);
             }
         }