Since `bgp->vnihash` is naturally non-NULL, remove check for this field.
Signed-off-by: anlan_cs <vic.lan@pica8.com>
struct bgpevpn *vpn;
struct in_addr mcast_grp = {INADDR_ANY};
- if (!bgp->vnihash)
- return NULL;
-
vpn = bgp_evpn_lookup_vni(bgp, vni);
if (!vpn) {
/* Check if this L2VNI is already configured as L3VNI */
*/
static void evpn_delete_vni(struct bgp *bgp, struct bgpevpn *vpn)
{
- assert(bgp->vnihash);
-
if (!is_vni_live(vpn)) {
bgp_evpn_free(bgp, vpn);
return;
if (bgp->advertise_all_vni)
vty_out(vty, " advertise-all-vni\n");
- if (bgp->vnihash) {
+ if (hashcount(bgp->vnihash)) {
struct list *vnilist = hash_to_list(bgp->vnihash);
struct listnode *ln;
struct bgpevpn *data;
BGP_L2VPN_EVPN_ADV_IPV6_UNICAST) ||
CHECK_FLAG(tmp_bgp->af_flags[AFI_L2VPN][SAFI_EVPN],
BGP_L2VPN_EVPN_ADV_IPV6_UNICAST_GW_IP))) ||
- (tmp_bgp->vnihash && hashcount(tmp_bgp->vnihash))) {
+ (hashcount(tmp_bgp->vnihash))) {
vty_out(vty,
"%% Cannot delete default BGP instance. Dependent VRF instances exist\n");
return CMD_WARNING_CONFIG_FAILED;