summaryrefslogtreecommitdiffstats
path: root/lib/vrf.c
diff options
context:
space:
mode:
authorChristophe Gouault <christophe.gouault@6wind.com>2020-08-24 18:01:15 +0200
committerChristophe Gouault <christophe.gouault@6wind.com>2020-09-21 10:17:35 +0200
commit1eb92f06c4e39a47a82ae585cfb276497843de6c (patch)
tree17ee7490850320dc573b80d0668da464cec41526 /lib/vrf.c
parentzebra: always display vrf in show ip route json (diff)
downloadfrr-1eb92f06c4e39a47a82ae585cfb276497843de6c.tar.xz
frr-1eb92f06c4e39a47a82ae585cfb276497843de6c.zip
vrf: VRF_DEFAULT must be 0, remove useless code
Code was added in the past to support a value of VRF_DEFAULT different from 0. This option was abandoned, the default vrf id is always 0. Remove this code, this will simplify the code and improve performance (use a constant value instead of a function that performs tests). Signed-off-by: Christophe Gouault <christophe.gouault@6wind.com>
Diffstat (limited to 'lib/vrf.c')
-rw-r--r--lib/vrf.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/lib/vrf.c b/lib/vrf.c
index a7e9b256f..1a9cd7e45 100644
--- a/lib/vrf.c
+++ b/lib/vrf.c
@@ -39,8 +39,7 @@
#include "northbound.h"
#include "northbound_cli.h"
-/* default VRF ID value used when VRF backend is not NETNS */
-#define VRF_DEFAULT_INTERNAL 0
+/* default VRF name value used when VRF backend is not NETNS */
#define VRF_DEFAULT_NAME_INTERNAL "default"
DEFINE_MTYPE_STATIC(LIB, VRF, "VRF")
@@ -521,7 +520,7 @@ void vrf_init(int (*create)(struct vrf *), int (*enable)(struct vrf *),
strlcpy(default_vrf->data.l.netns_name,
VRF_DEFAULT_NAME, NS_NAMSIZ);
- ns = ns_lookup(ns_get_default_id());
+ ns = ns_lookup(NS_DEFAULT);
ns->vrf_ctxt = default_vrf;
default_vrf->ns_ctxt = ns;
}
@@ -949,17 +948,6 @@ const char *vrf_get_default_name(void)
return vrf_default_name;
}
-vrf_id_t vrf_get_default_id(void)
-{
- /* backend netns is only known by zebra
- * for other daemons, we return VRF_DEFAULT_INTERNAL
- */
- if (vrf_is_backend_netns())
- return ns_get_default_id();
- else
- return VRF_DEFAULT_INTERNAL;
-}
-
int vrf_bind(vrf_id_t vrf_id, int fd, const char *name)
{
int ret = 0;