summaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorMatthew Smith <mgsmith@netgate.com>2020-10-12 15:04:39 -0500
committerMatthew Smith <mgsmith@netgate.com>2020-10-12 15:34:23 -0500
commit3a97a456ab27d21d7b25bb5505d93b0d96ab4cab (patch)
treeb1bd0760e74929a61d66aa38377629ef183c1648 /src/vnet
parent8c6988797e2a5d6da87fa73fee833ff3776b156b (diff)
l2: mark l2 fib uninitialized after clearing
Type: fix After clearing the l2fib with 'vppctl clear l2fib', a SEGV occurs the next time a MAC address is learned. In l2fib_clear_table(), the l2fib bihash is freed and then l2fib_table_init() is called to reinitialize it. l2fib_table_init() will not do anything if l2fib_main.mac_table_initialized is set to 1. Reset the value of l2fib_main.mac_table_initialized to 0 before calling l2fib_table_init(). Change-Id: I87f1a3f9a46c951f36c1c0a5ab795b0ec08c81a8 Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Diffstat (limited to 'src/vnet')
-rw-r--r--src/vnet/l2/l2_fib.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/vnet/l2/l2_fib.c b/src/vnet/l2/l2_fib.c
index bb4d61404a2..c28c23bc41c 100644
--- a/src/vnet/l2/l2_fib.c
+++ b/src/vnet/l2/l2_fib.c
@@ -388,6 +388,8 @@ l2fib_clear_table (void)
if (mp->mac_table_initialized == 0)
return;
+ mp->mac_table_initialized = 0;
+
/* Remove all entries */
BV (clib_bihash_free) (&mp->mac_table);
l2fib_table_init ();