summaryrefslogtreecommitdiff
path: root/zebra/zebra_vty.c
diff options
context:
space:
mode:
authoranlan_cs <vic.lan@pica8.com>2022-08-17 03:26:24 -0400
committeranlan_cs <vic.lan@pica8.com>2023-07-12 17:00:27 +0800
commitf8d94e8a628d123f299a4f388c58c8f8b222c6c2 (patch)
tree5bc78db1aa7239b0baaf906c7389cee8bc2bd208 /zebra/zebra_vty.c
parent30f511e63ac853465be7114322282fb5d833fa0c (diff)
zebra: remove unnecessary check for default vrf
The default vrf is generally non-NULL, except when shutdown. So, most of the time it is not necessary to check if it is NULL, we should remove the useless checks for it. Searched them with exact match: ``` grep -rI "zebra_vrf_lookup_by_id(VRF_DEFAULT)" | wc -l 31 ``` Signed-off-by: anlan_cs <vic.lan@pica8.com>
Diffstat (limited to 'zebra/zebra_vty.c')
-rw-r--r--zebra/zebra_vty.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index d100dc0e69..19366eb2c1 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -2703,13 +2703,8 @@ DEFUN (default_vrf_vni_mapping,
"Prefix routes only \n")
{
char xpath[XPATH_MAXLEN];
- struct zebra_vrf *zvrf = NULL;
int filter = 0;
- zvrf = zebra_vrf_lookup_by_id(VRF_DEFAULT);
- if (!zvrf)
- return CMD_WARNING;
-
if (argc == 3)
filter = 1;
@@ -2746,8 +2741,6 @@ DEFUN (no_default_vrf_vni_mapping,
struct zebra_vrf *zvrf = NULL;
zvrf = zebra_vrf_lookup_by_id(VRF_DEFAULT);
- if (!zvrf)
- return CMD_WARNING;
if (argc == 4)
filter = 1;