diff options
author | Damjan Marion <damarion@cisco.com> | 2017-07-27 04:07:50 -0400 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2017-07-31 17:07:56 +0000 |
commit | 6d19bcde9ca20fbae19ff5041cf3603d8ea5fc59 (patch) | |
tree | 934091ad147837ca2a8703a9b9d1e9fe965b3519 | |
parent | 7f6290e02e8d2e4b50f3758b33c90fecdc089938 (diff) |
Fix interface reuse when running multithreaded
Node function pointer was not set on all node runtimes causing crash if
new interface is different type.
Change-Id: I4661fe883befc6cd3fc6dfc14fd44f6fa5faf27c
Signed-off-by: Damjan Marion <damarion@cisco.com>
(cherry picked from commit c418e4ac7cf36bd64f3130c258d5f1897c245f2b)
-rw-r--r-- | src/vnet/interface.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/vnet/interface.c b/src/vnet/interface.c index 1370d048b0b..41d5276e290 100644 --- a/src/vnet/interface.c +++ b/src/vnet/interface.c @@ -787,14 +787,22 @@ vnet_register_interface (vnet_main_t * vnm, vnet_interface_output_node_flatten_multiarch_select () : vnet_interface_output_node_multiarch_select (); node->format_trace = format_vnet_interface_output_trace; - nrt = vlib_node_get_runtime (vm, hw->output_node_index); - nrt->function = node->function; + /* *INDENT-OFF* */ + foreach_vlib_main ({ + nrt = vlib_node_get_runtime (this_vlib_main, hw->output_node_index); + nrt->function = node->function; + }); + /* *INDENT-ON* */ node = vlib_get_node (vm, hw->tx_node_index); node->function = dev_class->tx_function; node->format_trace = dev_class->format_tx_trace; - nrt = vlib_node_get_runtime (vm, hw->tx_node_index); - nrt->function = node->function; + /* *INDENT-OFF* */ + foreach_vlib_main ({ + nrt = vlib_node_get_runtime (this_vlib_main, hw->tx_node_index); + nrt->function = node->function; + }); + /* *INDENT-ON* */ _vec_len (im->deleted_hw_interface_nodes) -= 1; } |