diff options
author | Christophe Gouault <christophe.gouault@6wind.com> | 2020-08-24 18:01:15 +0200 |
---|---|---|
committer | Christophe Gouault <christophe.gouault@6wind.com> | 2020-09-21 10:17:35 +0200 |
commit | 1eb92f06c4e39a47a82ae585cfb276497843de6c (patch) | |
tree | 17ee7490850320dc573b80d0668da464cec41526 /zebra/zebra_netns_id.c | |
parent | zebra: always display vrf in show ip route json (diff) | |
download | frr-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 'zebra/zebra_netns_id.c')
-rw-r--r-- | zebra/zebra_netns_id.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/zebra/zebra_netns_id.c b/zebra/zebra_netns_id.c index 79121bb08..3201c438c 100644 --- a/zebra/zebra_netns_id.c +++ b/zebra/zebra_netns_id.c @@ -39,9 +39,6 @@ #include "zebra/zebra_netns_id.h" #include "zebra/zebra_errors.h" -/* default NS ID value used when VRF backend is not NETNS */ -#define NS_DEFAULT_INTERNAL 0 - /* in case NEWNSID not available, the NSID will be locally obtained */ #define NS_BASE_NSID 0 @@ -362,14 +359,14 @@ ns_id_t zebra_ns_id_get_default(void) fd = open(NS_DEFAULT_NAME, O_RDONLY); if (fd == -1) - return NS_DEFAULT_INTERNAL; + return NS_DEFAULT; if (!vrf_is_backend_netns()) { close(fd); - return NS_DEFAULT_INTERNAL; + return NS_DEFAULT; } close(fd); return zebra_ns_id_get((char *)NS_DEFAULT_NAME, -1); #else /* HAVE_NETNS */ - return NS_DEFAULT_INTERNAL; + return NS_DEFAULT; #endif /* !HAVE_NETNS */ } |