diff options
Diffstat (limited to 'zebra')
-rw-r--r-- | zebra/zebra_evpn.c | 1 | ||||
-rw-r--r-- | zebra/zebra_evpn_mac.c | 1 | ||||
-rw-r--r-- | zebra/zebra_evpn_mh.c | 15 | ||||
-rw-r--r-- | zebra/zebra_evpn_neigh.c | 1 | ||||
-rw-r--r-- | zebra/zebra_fpm.c | 5 | ||||
-rw-r--r-- | zebra/zebra_mpls.c | 8 | ||||
-rw-r--r-- | zebra/zebra_nhg.c | 2 | ||||
-rw-r--r-- | zebra/zebra_vxlan.c | 9 |
8 files changed, 5 insertions, 37 deletions
diff --git a/zebra/zebra_evpn.c b/zebra/zebra_evpn.c index d223a21ed..121092a55 100644 --- a/zebra/zebra_evpn.c +++ b/zebra/zebra_evpn.c @@ -1022,7 +1022,6 @@ struct zebra_evpn *zebra_evpn_add(vni_t vni) memset(&tmp_zevpn, 0, sizeof(struct zebra_evpn)); tmp_zevpn.vni = vni; zevpn = hash_get(zvrf->evpn_table, &tmp_zevpn, zebra_evpn_alloc); - assert(zevpn); zebra_evpn_es_evi_init(zevpn); diff --git a/zebra/zebra_evpn_mac.c b/zebra/zebra_evpn_mac.c index 128d23396..5a1f5af5d 100644 --- a/zebra/zebra_evpn_mac.c +++ b/zebra/zebra_evpn_mac.c @@ -1105,7 +1105,6 @@ struct zebra_mac *zebra_evpn_mac_add(struct zebra_evpn *zevpn, memset(&tmp_mac, 0, sizeof(struct zebra_mac)); memcpy(&tmp_mac.macaddr, macaddr, ETH_ALEN); mac = hash_get(zevpn->mac_table, &tmp_mac, zebra_evpn_mac_alloc); - assert(mac); mac->zevpn = zevpn; mac->dad_mac_auto_recovery_timer = NULL; diff --git a/zebra/zebra_evpn_mh.c b/zebra/zebra_evpn_mh.c index b1e48374c..7728f5012 100644 --- a/zebra/zebra_evpn_mh.c +++ b/zebra/zebra_evpn_mh.c @@ -570,10 +570,7 @@ zebra_evpn_acc_vl_new(vlanid_t vid, struct interface *br_if) acc_bd->mbr_zifs = list_new(); /* Add to hash */ - if (!hash_get(zmh_info->evpn_vlan_table, acc_bd, hash_alloc_intern)) { - XFREE(MTYPE_ZACC_BD, acc_bd); - return NULL; - } + (void)hash_get(zmh_info->evpn_vlan_table, acc_bd, hash_alloc_intern); /* check if an svi exists for the vlan */ if (br_if) { @@ -1091,10 +1088,7 @@ static uint32_t zebra_evpn_nhid_alloc(struct zebra_evpn_es *es) nh_id = id | EVPN_NHG_ID_TYPE_BIT; /* Add to NHG hash */ es->nhg_id = nh_id; - if (!hash_get(zmh_info->nhg_table, es, hash_alloc_intern)) { - bf_release_index(zmh_info->nh_id_bitmap, id); - return 0; - } + (void)hash_get(zmh_info->nhg_table, es, hash_alloc_intern); } else { nh_id = id | EVPN_NH_ID_TYPE_BIT; } @@ -1361,10 +1355,7 @@ static struct zebra_evpn_l2_nh *zebra_evpn_l2_nh_alloc(struct in_addr vtep_ip) nh = XCALLOC(MTYPE_L2_NH, sizeof(*nh)); nh->vtep_ip = vtep_ip; - if (!hash_get(zmh_info->nh_ip_table, nh, hash_alloc_intern)) { - XFREE(MTYPE_L2_NH, nh); - return NULL; - } + (void)hash_get(zmh_info->nh_ip_table, nh, hash_alloc_intern); nh->nh_id = zebra_evpn_nhid_alloc(NULL); if (!nh->nh_id) { diff --git a/zebra/zebra_evpn_neigh.c b/zebra/zebra_evpn_neigh.c index ed224151b..734a53c57 100644 --- a/zebra/zebra_evpn_neigh.c +++ b/zebra/zebra_evpn_neigh.c @@ -553,7 +553,6 @@ static struct zebra_neigh *zebra_evpn_neigh_add(struct zebra_evpn *zevpn, memset(&tmp_n, 0, sizeof(struct zebra_neigh)); memcpy(&tmp_n.ip, ip, sizeof(struct ipaddr)); n = hash_get(zevpn->neigh_table, &tmp_n, zebra_evpn_neigh_alloc); - assert(n); n->state = ZEBRA_NEIGH_INACTIVE; n->zevpn = zevpn; diff --git a/zebra/zebra_fpm.c b/zebra/zebra_fpm.c index 6766c752a..7c57dfac6 100644 --- a/zebra/zebra_fpm.c +++ b/zebra/zebra_fpm.c @@ -1596,12 +1596,9 @@ static int zfpm_trigger_rmac_update(struct zebra_mac *rmac, UNSET_FLAG(fpm_mac->fpm_flags, ZEBRA_MAC_UPDATE_FPM); return 0; } - } else { + } else fpm_mac = hash_get(zfpm_g->fpm_mac_info_table, &key, zfpm_mac_info_alloc); - if (!fpm_mac) - return 0; - } fpm_mac->r_vtep_ip.s_addr = rmac->fwd_info.r_vtep_ip.s_addr; fpm_mac->zebra_flags = rmac->flags; diff --git a/zebra/zebra_mpls.c b/zebra/zebra_mpls.c index 924a43049..de7b6a177 100644 --- a/zebra/zebra_mpls.c +++ b/zebra/zebra_mpls.c @@ -188,8 +188,6 @@ static int lsp_install(struct zebra_vrf *zvrf, mpls_label_t label, /* Locate or allocate LSP entry. */ tmp_ile.in_label = label; lsp = hash_get(lsp_table, &tmp_ile, lsp_alloc); - if (!lsp) - return -1; /* For each active nexthop, create NHLFE. Note that we deliberately skip * recursive nexthops right now, because intermediate hops won't @@ -2920,8 +2918,6 @@ int mpls_zapi_labels_process(bool add_p, struct zebra_vrf *zvrf, /* Find or create LSP object */ tmp_ile.in_label = zl->local_label; lsp = hash_get(lsp_table, &tmp_ile, lsp_alloc); - if (!lsp) - return -1; } /* Prep for route/FEC update if requested */ @@ -3199,8 +3195,6 @@ int mpls_lsp_install(struct zebra_vrf *zvrf, enum lsp_types_t type, /* Find or create LSP object */ tmp_ile.in_label = in_label; lsp = hash_get(lsp_table, &tmp_ile, lsp_alloc); - if (!lsp) - return -1; nhlfe = lsp_add_nhlfe(lsp, type, num_out_labels, out_labels, gtype, gate, ifindex, false /*backup*/); @@ -3562,8 +3556,6 @@ int zebra_mpls_static_lsp_add(struct zebra_vrf *zvrf, mpls_label_t in_label, /* Find or create LSP. */ tmp_ile.in_label = in_label; lsp = hash_get(slsp_table, &tmp_ile, lsp_alloc); - if (!lsp) - return -1; nhlfe = nhlfe_find(&lsp->nhlfe_list, ZEBRA_LSP_STATIC, gtype, gate, ifindex); diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c index 069d35c6a..cf09902d5 100644 --- a/zebra/zebra_nhg.c +++ b/zebra/zebra_nhg.c @@ -329,7 +329,7 @@ static int zebra_nhg_insert_id(struct nhg_hash_entry *nhe) return -1; } - hash_get(zrouter.nhgs_id, nhe, hash_alloc_intern); + (void)hash_get(zrouter.nhgs_id, nhe, hash_alloc_intern); return 0; } diff --git a/zebra/zebra_vxlan.c b/zebra/zebra_vxlan.c index fc7eb8c87..d883336f0 100644 --- a/zebra/zebra_vxlan.c +++ b/zebra/zebra_vxlan.c @@ -1189,8 +1189,6 @@ static struct zebra_mac *zl3vni_rmac_add(struct zebra_l3vni *zl3vni, memset(&tmp_rmac, 0, sizeof(struct zebra_mac)); memcpy(&tmp_rmac.macaddr, rmac, ETH_ALEN); zrmac = hash_get(zl3vni->rmac_table, &tmp_rmac, zl3vni_rmac_alloc); - assert(zrmac); - zrmac->nh_list = list_new(); zrmac->nh_list->cmp = (int (*)(void *, void *))l3vni_rmac_nh_list_cmp; zrmac->nh_list->del = (void (*)(void *))l3vni_rmac_nh_free; @@ -1466,7 +1464,6 @@ static struct zebra_neigh *zl3vni_nh_add(struct zebra_l3vni *zl3vni, memset(&tmp_n, 0, sizeof(struct zebra_neigh)); memcpy(&tmp_n.ip, ip, sizeof(struct ipaddr)); n = hash_get(zl3vni->nh_table, &tmp_n, zl3vni_nh_alloc); - assert(n); RB_INIT(host_rb_tree_entry, &n->host_rb); @@ -1696,7 +1693,6 @@ static struct zebra_l3vni *zl3vni_add(vni_t vni, vrf_id_t vrf_id) tmp_zl3vni.vni = vni; zl3vni = hash_get(zrouter.l3vni_table, &tmp_zl3vni, zl3vni_alloc); - assert(zl3vni); zl3vni->vrf_id = vrf_id; zl3vni->svi_if = NULL; @@ -6039,11 +6035,6 @@ static struct zebra_vxlan_sg *zebra_vxlan_sg_add(struct zebra_vrf *zvrf, } vxlan_sg = zebra_vxlan_sg_new(zvrf, sg); - if (!vxlan_sg) { - if (parent) - zebra_vxlan_sg_do_deref(zvrf, sip, sg->grp); - return vxlan_sg; - } zebra_vxlan_sg_send(zvrf, sg, vxlan_sg->sg_str, ZEBRA_VXLAN_SG_ADD); |