zebra: remove one unnecessary check for l3vni nb

The parent node of "vrf"  MUST be non-NULL, so the check is unnecessary and
misleading. Otherwise, there will be a branch of NULL parent node, it makes
no sense, remove it.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
This commit is contained in:
anlan_cs 2022-05-18 21:55:33 -04:00
parent d37879b7a2
commit c331ef1665

View File

@ -1163,7 +1163,6 @@ int lib_vrf_zebra_l3vni_id_modify(struct nb_cb_modify_args *args)
* if zebra vrf already mapped to different vni id.
*/
pn_dnode = yang_dnode_get_parent(args->dnode, "vrf");
if (pn_dnode) {
vrfname = yang_dnode_get_string(pn_dnode, "./name");
zvrf = zebra_vrf_lookup_by_name(vrfname);
if (!zvrf) {
@ -1179,7 +1178,6 @@ int lib_vrf_zebra_l3vni_id_modify(struct nb_cb_modify_args *args)
vni, zvrf->l3vni);
return NB_ERR_VALIDATION;
}
}
/* Check if this VNI is already present in the system */
zl3vni = zl3vni_lookup(vni);