From 81157cbd10d3ebc6d3d31cb5617dadea1c98d454 Mon Sep 17 00:00:00 2001 From: anlan_cs Date: Fri, 13 May 2022 21:02:11 -0400 Subject: zebra: remove unnecessary check for "zevpn_vrf" The global vrf in zebra is always non-NULL. In general, it is bound to default vrf by `zebra_vrf_init()`, at other times bound to some specific vrf. Anyway, non-NULL. So remove all redundant checkings for the returned value of `zebra_vrf_get_evpn()`. Additionally, remove the unnecessary check for `zvrf` in `zebra_vxlan_cleanup_tables()`. Signed-off-by: anlan_cs --- zebra/zebra_nb_config.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'zebra/zebra_nb_config.c') diff --git a/zebra/zebra_nb_config.c b/zebra/zebra_nb_config.c index de94c2dfc..87356408d 100644 --- a/zebra/zebra_nb_config.c +++ b/zebra/zebra_nb_config.c @@ -1148,7 +1148,6 @@ int lib_vrf_zebra_l3vni_id_modify(struct nb_cb_modify_args *args) struct zebra_vrf *zvrf; vni_t vni = 0; struct zebra_l3vni *zl3vni = NULL; - struct zebra_vrf *zvrf_evpn = NULL; char err[ERR_STR_SZ]; bool pfx_only = false; const struct lyd_node *pn_dnode; @@ -1159,12 +1158,6 @@ int lib_vrf_zebra_l3vni_id_modify(struct nb_cb_modify_args *args) case NB_EV_ABORT: return NB_OK; case NB_EV_VALIDATE: - zvrf_evpn = zebra_vrf_get_evpn(); - if (!zvrf_evpn) { - snprintf(args->errmsg, args->errmsg_len, - "evpn vrf is not present."); - return NB_ERR_VALIDATION; - } vni = yang_dnode_get_uint32(args->dnode, NULL); /* Get vrf info from parent node, reject configuration * if zebra vrf already mapped to different vni id. -- cgit v1.2.3