ip: fix ip table allocation randomness 23/33823/3
authorAloys Augustin <aloaugus@cisco.com>
Sun, 26 Sep 2021 16:26:15 +0000 (18:26 +0200)
committerNeale Ranns <neale@graphiant.com>
Mon, 27 Sep 2021 07:15:46 +0000 (07:15 +0000)
This prevents going through the same sequence every time the api is
called.

Type: fix
Change-Id: I3ca3587ab5d1c060e2913ca88501b8dbcdd9c196
Signed-off-by: Aloys Augustin <aloaugus@cisco.com>
src/vnet/ip/ip_api.c

index f5ebd02..b5f3e93 100644 (file)
@@ -608,7 +608,7 @@ u32
 ip_table_get_unused_id (fib_protocol_t fproto)
 {
   int i, j;
-  u32 seed = random_default_seed ();
+  static u32 seed = 0;
   /* limit to 1M tries */
   for (j = 0; j < 1 << 10; j++)
     {