Remove ability to override netns
This gives a lot of operational problems later. It's definitely reasonable to be able to create tap interfaces in other namespaces, and this is still possible (see below for syntax). However, changing the runtime netns makes the netlink listener much more complicated because it will have to listen on not just one netns, but all of them, for netlink updates. So, for now, let's remove the ability to set the namespace in the API. Still possible: - set at startup.conf in lcpng { netns <x> } - force creating in 'lcpng create ... netns <x>' This will nudge folks to create one singular namespace (say, 'dataplane', in the startup.conf), and then handle all netlink messages in that namespace only.
This commit is contained in:
@ -111,45 +111,6 @@ VLIB_CLI_COMMAND (lcp_itf_pair_create_command, static) = {
|
||||
.function = lcp_itf_pair_create_command_fn,
|
||||
};
|
||||
|
||||
static clib_error_t *
|
||||
lcp_default_netns_command_fn (vlib_main_t *vm, unformat_input_t *input,
|
||||
vlib_cli_command_t *cmd)
|
||||
{
|
||||
unformat_input_t _line_input, *line_input = &_line_input;
|
||||
u8 *ns;
|
||||
int r;
|
||||
|
||||
if (!unformat_user (input, unformat_line_input, line_input))
|
||||
return 0;
|
||||
|
||||
ns = 0;
|
||||
|
||||
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
|
||||
{
|
||||
if (unformat (line_input, "netns %s", &ns))
|
||||
;
|
||||
else if (unformat (line_input, "clear netns"))
|
||||
;
|
||||
}
|
||||
|
||||
unformat_free (line_input);
|
||||
|
||||
vlib_cli_output (vm, "lcp set default netns '%s'\n", (char *) ns);
|
||||
|
||||
r = lcp_set_default_ns (ns);
|
||||
|
||||
if (r)
|
||||
return clib_error_return (0, "lcnpg set default netns failed (%d)", r);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
VLIB_CLI_COMMAND (lcp_default_netns_command, static) = {
|
||||
.path = "lcpng default",
|
||||
.short_help = "lcpng default netns [<namespace>]",
|
||||
.function = lcp_default_netns_command_fn,
|
||||
};
|
||||
|
||||
static clib_error_t *
|
||||
lcp_itf_pair_delete_command_fn (vlib_main_t *vm, unformat_input_t *input,
|
||||
vlib_cli_command_t *cmd)
|
||||
|
Reference in New Issue
Block a user