diff options
author | anlan_cs <vic.lan@pica8.com> | 2022-08-17 09:26:24 +0200 |
---|---|---|
committer | anlan_cs <vic.lan@pica8.com> | 2023-07-12 11:00:27 +0200 |
commit | f8d94e8a628d123f299a4f388c58c8f8b222c6c2 (patch) | |
tree | 5bc78db1aa7239b0baaf906c7389cee8bc2bd208 /zebra/table_manager.c | |
parent | Merge pull request #13925 from Keelan10/bgpd-leak (diff) | |
download | frr-f8d94e8a628d123f299a4f388c58c8f8b222c6c2.tar.xz frr-f8d94e8a628d123f299a4f388c58c8f8b222c6c2.zip |
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/table_manager.c')
-rw-r--r-- | zebra/table_manager.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/zebra/table_manager.c b/zebra/table_manager.c index 77ec42e64..512508b79 100644 --- a/zebra/table_manager.c +++ b/zebra/table_manager.c @@ -63,8 +63,7 @@ void table_manager_enable(struct zebra_vrf *zvrf) && strcmp(zvrf_name(zvrf), VRF_DEFAULT_NAME)) { struct zebra_vrf *def = zebra_vrf_lookup_by_id(VRF_DEFAULT); - if (def) - zvrf->tbl_mgr = def->tbl_mgr; + zvrf->tbl_mgr = def->tbl_mgr; return; } zvrf->tbl_mgr = XCALLOC(MTYPE_TM_TABLE, sizeof(struct table_manager)); |