mirror of
https://git.proxmox.com/git/mirror_frr
synced 2026-01-27 00:06:46 +00:00
zebra: make vrf netns commands do nothing
These commands don't really provide any functionality. VRF is associated with netns automatically based on its name, and it's not possible to associate VRF and netns with different names with these commands: - When trying to assosiate a VRF with an already existing netns with a different name: `NS /run/netns/test is already configured with VRF 1(test)` - When trying to assiciate a VRF with a non-existing netns, so they become linked once the netns is created: `Invalid pathname for /run/netns/test: No such file or directory` - When doing "no netns" to unlink the netns and link it back to the same VRF: `VRF 1 is already configured with VRF test` - When doing "no netns" to unlink the netns and link it to another VRF: `Can not associate NS 4294967295 with NETNS /run/netns/test` As shown above, not a single usecase is working. We can't remove them completely to preserve backwards-compatibility, so just make them empty. The main reason for this change is not to spend a lot of time trying to figure out how to convert them to northbound. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
This commit is contained in:
parent
86855aed78
commit
d6bd4fca97
@ -536,20 +536,7 @@ DEFPY (vrf_netns,
|
||||
"Attach VRF to a Namespace\n"
|
||||
"The file name in " NS_RUN_DIR ", or a full pathname\n")
|
||||
{
|
||||
char *pathname = ns_netns_pathname(vty, netns_name);
|
||||
int ret;
|
||||
|
||||
VTY_DECLVAR_CONTEXT(vrf, vrf);
|
||||
|
||||
if (!pathname)
|
||||
return CMD_WARNING_CONFIG_FAILED;
|
||||
|
||||
frr_with_privs(&zserv_privs) {
|
||||
ret = zebra_vrf_netns_handler_create(
|
||||
vty, vrf, pathname, NS_UNKNOWN, NS_UNKNOWN, NS_UNKNOWN);
|
||||
}
|
||||
|
||||
return ret;
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
DEFUN (no_vrf_netns,
|
||||
@ -559,29 +546,6 @@ DEFUN (no_vrf_netns,
|
||||
"Detach VRF from a Namespace\n"
|
||||
"The file name in " NS_RUN_DIR ", or a full pathname\n")
|
||||
{
|
||||
struct ns *ns = NULL;
|
||||
|
||||
VTY_DECLVAR_CONTEXT(vrf, vrf);
|
||||
|
||||
if (!vrf_is_backend_netns()) {
|
||||
vty_out(vty, "VRF backend is not Netns. Aborting\n");
|
||||
return CMD_WARNING_CONFIG_FAILED;
|
||||
}
|
||||
if (!vrf->ns_ctxt) {
|
||||
vty_out(vty, "VRF %s(%u) is not configured with NetNS\n",
|
||||
vrf->name, vrf->vrf_id);
|
||||
return CMD_WARNING_CONFIG_FAILED;
|
||||
}
|
||||
|
||||
ns = (struct ns *)vrf->ns_ctxt;
|
||||
|
||||
ns->vrf_ctxt = NULL;
|
||||
vrf_disable(vrf);
|
||||
/* vrf ID from VRF is necessary for Zebra
|
||||
* so that propagate to other clients is done
|
||||
*/
|
||||
ns_delete(ns);
|
||||
vrf->ns_ctxt = NULL;
|
||||
return CMD_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user