nsh: fix nsh gre references

Since gre is a plugin, nsh should not use symbol names directly.

Type: fix
Fixes: cefb178aa487a217d4ac75d7d4fa62db4b7d70fd

Change-Id: I1a1c20740aabdaafd69f507cd71016c3109b0205
Signed-off-by: Benoît Ganne <bganne@cisco.com>
This commit is contained in:
Benoît Ganne
2023-08-04 16:13:43 +02:00
parent faeadca89e
commit 994a58997d

View File

@ -184,7 +184,7 @@ nsh_md2_set_next_ioam_export_override (uword next)
clib_error_t *
nsh_init (vlib_main_t * vm)
{
vlib_node_t *node;
vlib_node_t *node, *gre4_input, *gre6_input;
nsh_main_t *nm = &nsh_main;
clib_error_t *error = 0;
uword next_node;
@ -240,15 +240,19 @@ nsh_init (vlib_main_t * vm)
vlib_node_add_next (vm, vxlan6_gpe_input_node.index,
nsh_aware_vnf_proxy_node.index);
vlib_node_add_next (vm, gre4_input_node.index, nm->nsh_input_node_index);
vlib_node_add_next (vm, gre4_input_node.index, nm->nsh_proxy_node_index);
vlib_node_add_next (vm, gre4_input_node.index,
nsh_aware_vnf_proxy_node.index);
vlib_node_add_next (vm, gre6_input_node.index, nm->nsh_input_node_index);
vlib_node_add_next (vm, gre6_input_node.index, nm->nsh_proxy_node_index);
vlib_node_add_next (vm, gre6_input_node.index,
nsh_aware_vnf_proxy_node.index);
gre4_input = vlib_get_node_by_name (vm, (u8 *) "gre4-input");
gre6_input = vlib_get_node_by_name (vm, (u8 *) "gre6-input");
if (gre4_input == 0 || gre6_input == 0)
{
error = clib_error_return (0, "gre_plugin.so is not loaded");
return error;
}
vlib_node_add_next (vm, gre4_input->index, nm->nsh_input_node_index);
vlib_node_add_next (vm, gre4_input->index, nm->nsh_proxy_node_index);
vlib_node_add_next (vm, gre4_input->index, nsh_aware_vnf_proxy_node.index);
vlib_node_add_next (vm, gre6_input->index, nm->nsh_input_node_index);
vlib_node_add_next (vm, gre6_input->index, nm->nsh_proxy_node_index);
vlib_node_add_next (vm, gre6_input->index, nsh_aware_vnf_proxy_node.index);
/* Add NSH-Proxy support */
vxlan4_input =