From 1eb92f06c4e39a47a82ae585cfb276497843de6c Mon Sep 17 00:00:00 2001 From: Christophe Gouault Date: Mon, 24 Aug 2020 18:01:15 +0200 Subject: 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 --- lib/netns_linux.c | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'lib/netns_linux.c') diff --git a/lib/netns_linux.c b/lib/netns_linux.c index e8d549b4e..c68843398 100644 --- a/lib/netns_linux.c +++ b/lib/netns_linux.c @@ -43,9 +43,6 @@ DEFINE_MTYPE_STATIC(LIB, NS, "NetNS Context") DEFINE_MTYPE_STATIC(LIB, NS_NAME, "NetNS Name") -/* default NS ID value used when VRF backend is not NETNS */ -#define NS_DEFAULT_INTERNAL 0 - static inline int ns_compare(const struct ns *ns, const struct ns *ns2); static struct ns *ns_lookup_name_internal(const char *name); @@ -101,9 +98,6 @@ static inline int setns(int fd, int nstype) static int have_netns_enabled = -1; #endif /* HAVE_NETNS */ -/* default NS ID value used when VRF backend is not NETNS */ -#define NS_DEFAULT_INTERNAL 0 - static int have_netns(void) { #ifdef HAVE_NETNS @@ -612,15 +606,7 @@ ns_id_t ns_id_get_absolute(ns_id_t ns_id_reference, ns_id_t link_nsid) return ns->ns_id; } -ns_id_t ns_get_default_id(void) -{ - if (default_ns) - return default_ns->ns_id; - return NS_DEFAULT_INTERNAL; -} - struct ns *ns_get_default(void) { return default_ns; } - -- cgit v1.2.3