/* If already same aspath exist then return it. */
find = hash_get(ashash, &as, aspath_hash_alloc);
- /* bug! should not happen, let the daemon crash below */
- assert(find);
-
/* if the aspath was already hashed free temporary memory. */
if (find->refcnt) {
assegment_free_all(as.segments);
new->name_hash = bgp_clist_hash_key_community_list(new);
/* Save for later */
- hash_get(cm->hash, new, hash_alloc_intern);
+ (void)hash_get(cm->hash, new, hash_alloc_intern);
/* If name is made by all digit character. We treat it as
number. */
void bgp_ca_community_insert(struct community_alias *ca)
{
- hash_get(bgp_ca_community_hash, ca, bgp_community_alias_alloc);
+ (void)hash_get(bgp_ca_community_hash, ca, bgp_community_alias_alloc);
}
void bgp_ca_alias_insert(struct community_alias *ca)
{
- hash_get(bgp_ca_alias_hash, ca, bgp_community_alias_alloc);
+ (void)hash_get(bgp_ca_alias_hash, ca, bgp_community_alias_alloc);
}
void bgp_ca_community_delete(struct community_alias *ca)
}
ip = hash_get(vpn->remote_ip_hash, &tmp, bgp_evpn_remote_ip_hash_alloc);
- if (!ip)
- return;
-
(void)listnode_add(ip->macip_path_list, pi);
bgp_evpn_remote_ip_process_nexthops(vpn, &ip->addr, true);
if (vpn->svi_ifindex == 0)
return;
- hash_get(bgp->vni_svi_hash, vpn, hash_alloc_intern);
+ (void)hash_get(bgp->vni_svi_hash, vpn, hash_alloc_intern);
}
static void bgp_evpn_unlink_from_vni_svi_hash(struct bgp *bgp,
* so the hash_release is the same for either.
*/
hash_release(peer->bgp->peerhash, peer);
- hash_get(peer->bgp->peerhash, peer, hash_alloc_intern);
+ (void)hash_get(peer->bgp->peerhash, peer, hash_alloc_intern);
/* Start BFD peer if not already running. */
if (peer->bfd_config)
holder.peer = peer;
if (!hash_lookup(peerhash, &holder)) {
struct pkat *pkat = pkat_new(peer);
- hash_get(peerhash, pkat, hash_alloc_intern);
+ (void)hash_get(peerhash, pkat, hash_alloc_intern);
peer_lock(peer);
}
SET_FLAG(peer->thread_flags, PEER_THREAD_KEEPALIVES_ON);
peer = peer_create(&su, peer1->conf_if, peer1->bgp, peer1->local_as,
peer1->as, peer1->as_type, NULL);
hash_release(peer->bgp->peerhash, peer);
- hash_get(peer->bgp->peerhash, peer, hash_alloc_intern);
+ (void)hash_get(peer->bgp->peerhash, peer, hash_alloc_intern);
peer_xfer_config(peer, peer1);
bgp_peer_gr_flags_update(peer);
tmp.addr = *tip;
addr = hash_get(bgp->tip_hash, &tmp, bgp_tip_hash_alloc);
- if (!addr)
- return;
-
addr->refcnt++;
}
pbr_rule.action = bpa;
bpr = hash_get(bgp->pbr_rule_hash, &pbr_rule,
bgp_pbr_rule_alloc_intern);
- if (bpr && bpr->unique == 0) {
+ if (bpr->unique == 0) {
bpr->unique = ++bgp_pbr_action_counter_unique;
bpr->installed = false;
bpr->install_in_progress = false;
} else
bpr_found = true;
/* already installed */
- if (bpr_found && bpr) {
+ if (bpr_found) {
struct bgp_path_info_extra *extra =
bgp_path_info_extra_get(path);
bgp_pbr_bpa_add(bpa);
/* ip rule add */
- if (bpr && !bpr->installed)
+ if (!bpr->installed)
bgp_send_pbr_rule_action(bpa, bpr, true);
/* A previous entry may already exist
updgrp = hash_get(paf->peer->bgp->update_groups[paf->afid], &tmp,
updgrp_hash_alloc);
- if (!updgrp)
- return NULL;
update_group_checkin(updgrp);
if (BGP_DEBUG(update_groups, UPDATE_GROUPS))
/*
* Since our su changed we need to del/add peer to the peerhash
*/
- hash_get(peer->bgp->peerhash, peer, hash_alloc_intern);
+ (void)hash_get(peer->bgp->peerhash, peer, hash_alloc_intern);
}
void bgp_recalculate_afi_safi_bestpaths(struct bgp *bgp, afi_t afi, safi_t safi)
peer = peer_lock(peer); /* bgp peer list reference */
peer->group = group;
listnode_add_sort(bgp->peer, peer);
- hash_get(bgp->peerhash, peer, hash_alloc_intern);
+ (void)hash_get(bgp->peerhash, peer, hash_alloc_intern);
/* Adjust update-group coalesce timer heuristics for # peers. */
if (bgp->heuristic_coalesce) {
void isis_lfa_excluded_iface_add(struct isis_circuit *circuit, int level,
const char *ifname)
{
- hash_get(circuit->lfa_excluded_ifaces[level - 1], (char *)ifname,
- lfa_excl_interface_hash_alloc);
+ (void)hash_get(circuit->lfa_excluded_ifaces[level - 1], (char *)ifname,
+ lfa_excl_interface_hash_alloc);
}
/**
struct isis_vertex *vertex = arg;
struct isis_vertex *hop = bucket->data;
- hash_get(vertex->firsthops, hop, hash_alloc_intern);
+ (void)hash_get(vertex->firsthops, hop, hash_alloc_intern);
}
static void vertex_update_firsthops(struct isis_vertex *vertex,
struct isis_vertex *parent)
{
if (vertex->d_N <= 2)
- hash_get(vertex->firsthops, vertex, hash_alloc_intern);
+ (void)hash_get(vertex->firsthops, vertex, hash_alloc_intern);
if (vertex->d_N < 2 || !parent)
return;
if (vertex->N.ip.sr.label != MPLS_INVALID_LABEL)
vertex->N.ip.sr.present = true;
- hash_get(spftree->prefix_sids, vertex,
- hash_alloc_intern);
+ (void)hash_get(spftree->prefix_sids, vertex,
+ hash_alloc_intern);
}
}
return;
}
- assert(hash_get(cnode->cmd_hash, (void *)cmd, hash_alloc_intern));
+ (void)hash_get(cnode->cmd_hash, (void *)cmd, hash_alloc_intern);
if (cnode->graph_built || !defer_cli_tree) {
struct graph *graph = graph_new();
frr_with_mutex(&refs_mtx) {
while (ref[i].code != END_FERR) {
- hash_get(refs, &ref[i], hash_alloc_intern);
+ (void)hash_get(refs, &ref[i], hash_alloc_intern);
i++;
}
}
assert(!"Type codec double-registered.");
}
- assert(hash_get(codec_hash, &c, codec_alloc));
+ (void)hash_get(codec_hash, &c, codec_alloc);
}
void frrscript_register_type_codecs(struct frrscript_codec *codecs)
/* Add the Lua function state to frrscript */
struct lua_function_state key = {.name = function_name, .L = L};
- hash_get(fs->lua_function_hash, &key, lua_function_alloc);
+ (void)hash_get(fs->lua_function_hash, &key, lua_function_alloc);
return 0;
fail:
strlcpy(entry->xpath, newpath, sizeof(entry->xpath));
XFREE(MTYPE_TMP, newpath);
- hash_get(running_config_entries, entry, hash_alloc_intern);
+ (void)hash_get(running_config_entries, entry,
+ hash_alloc_intern);
}
list_delete(&entries);
if (++p->next_request_id == 0)
p->next_request_id = 1;
r->cb = cb;
- hash_get(p->reqid_hash, r, hash_alloc_intern);
+ (void)hash_get(p->reqid_hash, r, hash_alloc_intern);
}
return r->request_id;
}
ospf6_link_route_to_aggr(struct ospf6_external_aggr_rt *aggr,
struct ospf6_route *rt)
{
- hash_get(aggr->match_extnl_hash, rt, hash_alloc_intern);
+ (void)hash_get(aggr->match_extnl_hash, rt, hash_alloc_intern);
rt->aggr_route = aggr;
}
} else {
/* Add the routerid to the enable router hash table */
- hash_get(ospf6->ospf6_helper_cfg.enable_rtr_list, &temp,
- ospf6_enable_rtr_hash_alloc);
+ (void)hash_get(ospf6->ospf6_helper_cfg.enable_rtr_list, &temp,
+ ospf6_enable_rtr_hash_alloc);
}
}
"%s: Linking extrenal route(%pI4/%d) to aggregator(%pI4/%d)",
__func__, &ei->p.prefix, ei->p.prefixlen,
&aggr->p.prefix, aggr->p.prefixlen);
- hash_get(aggr->match_extnl_hash, ei, hash_alloc_intern);
+ (void)hash_get(aggr->match_extnl_hash, ei, hash_alloc_intern);
ei->aggr_route = aggr;
}
} else {
/* Add the routerid to the enable router hash table */
- hash_get(ospf->enable_rtr_list, &temp,
- ospf_enable_rtr_hash_alloc);
+ (void)hash_get(ospf->enable_rtr_list, &temp,
+ ospf_enable_rtr_hash_alloc);
}
}
srn = (struct sr_node *)hash_get(OspfSR.neighbors,
&lsah->adv_router,
(void *)sr_node_new);
- /* Sanity check */
- if (srn == NULL) {
- flog_err(
- EC_OSPF_SR_NODE_CREATE,
- "SR (%s): Abort! can't create SR node in hash table",
- __func__);
- return;
- }
/* update LSA ID */
srn->instance = ntohl(lsah->id.s_addr);
/* Copy SRGB */
(void *)&(lsah->adv_router),
(void *)sr_node_new);
- /* Sanity check */
- if (srn == NULL) {
- flog_err(EC_OSPF_SR_NODE_CREATE,
- "SR (%s): Abort! can't create SR node in hash table",
- __func__);
- return;
- }
-
/* Initialize TLV browsing */
length = lsa->size - OSPF_LSA_HEADER_SIZE;
for (tlvh = TLV_HDR_TOP(lsah); length > 0 && tlvh;
srn = (struct sr_node *)hash_get(OspfSR.neighbors,
(void *)&(lsah->adv_router),
(void *)sr_node_new);
-
- /* Sanity check */
- if (srn == NULL) {
- flog_err(EC_OSPF_SR_NODE_CREATE,
- "SR (%s): Abort! can't create SR node in hash table",
- __func__);
- return;
- }
-
/* Initialize TLV browsing */
length = lsa->size - OSPF_LSA_HEADER_SIZE;
for (tlvh = TLV_HDR_TOP(lsah); length > 0 && tlvh;
nhrcvi.nhrc);
nhrcvi.nhrc->nexthop.vrf_id =
pbr_vrf_id(pnhi->pbr_vrf);
- hash_get(pbr_nhrc_hash, nhrcvi.nhrc,
- hash_alloc_intern);
+ (void)hash_get(pbr_nhrc_hash,
+ nhrcvi.nhrc,
+ hash_alloc_intern);
pbr_send_rnh(&nhrcvi.nhrc->nexthop, true);
}
} while (nhrcvi.nhrc);
if (pnhi.pnhc) {
pnhi.pnhc->nexthop.vrf_id = pbr_vrf_id(pbr_vrf);
- hash_get(pnhgc->nhh, pnhi.pnhc, hash_alloc_intern);
+ (void)hash_get(pnhgc->nhh, pnhi.pnhc,
+ hash_alloc_intern);
} else
pnhc->nexthop.vrf_id = pbr_vrf_id(pbr_vrf);
if (nhrc) {
hash_release(pbr_nhrc_hash, nhrc);
nhrc->nexthop.ifindex = ifp->ifindex;
- hash_get(pbr_nhrc_hash, nhrc, hash_alloc_intern);
+ (void)hash_get(pbr_nhrc_hash, nhrc, hash_alloc_intern);
}
pnhi.pnhc->nexthop.ifindex = ifp->ifindex;
- hash_get(pnhgc->nhh, pnhi.pnhc, hash_alloc_intern);
+ (void)hash_get(pnhgc->nhh, pnhi.pnhc, hash_alloc_intern);
pbr_map_check_interface_nh_group_change(pnhgc->name, ifp,
old_ifindex);
nhgc->table_id = pbr_next_unallocated_table_id;
/* Mark table id as allocated in id-indexed hash */
- hash_get(pbr_nhg_allocated_id_hash, nhgc, hash_alloc_intern);
+ (void)hash_get(pbr_nhg_allocated_id_hash, nhgc, hash_alloc_intern);
/* Pre-compute the next unallocated table id */
pbr_nht_update_next_unallocated_table_id();
}
if (up != NULL)
- hash_get(pnc->upstream_hash, up, hash_alloc_intern);
+ (void)hash_get(pnc->upstream_hash, up, hash_alloc_intern);
if (CHECK_FLAG(pnc->flags, PIM_NEXTHOP_VALID)) {
if (out_pnc)
}
rn->info = (void *)0xdeadbeef;
- hash_get(test->log, hash_entry, log_alloc);
+ (void)hash_get(test->log, hash_entry, log_alloc);
};
static void test_state_del_route(struct test_state *test,
vrrp_set_advertisement_interval(vr, vd.advertisement_interval);
- hash_get(vrrp_vrouters_hash, vr, hash_alloc_intern);
+ (void)hash_get(vrrp_vrouters_hash, vr, hash_alloc_intern);
return vr;
}
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);
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;
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) {
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;
}
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) {
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;
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;
/* 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
/* 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 */
/* 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*/);
/* 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);
return -1;
}
- hash_get(zrouter.nhgs_id, nhe, hash_alloc_intern);
+ (void)hash_get(zrouter.nhgs_id, nhe, hash_alloc_intern);
return 0;
}
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;
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);
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;
}
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);