Skip to content

Commit

Permalink
*: list_delete_and_null() -> list_delete()
Browse files Browse the repository at this point in the history
Signed-off-by: David Lamparter <[email protected]>
  • Loading branch information
eqvinox committed Oct 2, 2018
1 parent b08bb12 commit 6a154c8
Show file tree
Hide file tree
Showing 101 changed files with 239 additions and 239 deletions.
16 changes: 8 additions & 8 deletions bgpd/bgp_evpn.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ static void vrf_import_rt_free(struct vrf_irt_node *irt)
}

hash_release(bgp_def->vrf_import_rt_hash, irt);
list_delete_and_null(&irt->vrfs);
list_delete(&irt->vrfs);
XFREE(MTYPE_BGP_EVPN_VRF_IMPORT_RT, irt);
}

Expand Down Expand Up @@ -313,7 +313,7 @@ static struct irt_node *import_rt_new(struct bgp *bgp,
static void import_rt_free(struct bgp *bgp, struct irt_node *irt)
{
hash_release(bgp->import_rt_hash, irt);
list_delete_and_null(&irt->vnis);
list_delete(&irt->vnis);
XFREE(MTYPE_BGP_EVPN_IMPORT_RT, irt);
}

Expand Down Expand Up @@ -4988,8 +4988,8 @@ void bgp_evpn_free(struct bgp *bgp, struct bgpevpn *vpn)
bgpevpn_unlink_from_l3vni(vpn);
bgp_table_unlock(vpn->route_table);
bgp_evpn_unmap_vni_from_its_rts(bgp, vpn);
list_delete_and_null(&vpn->import_rtl);
list_delete_and_null(&vpn->export_rtl);
list_delete(&vpn->import_rtl);
list_delete(&vpn->export_rtl);
bf_release_index(bm->rd_idspace, vpn->rd_id);
hash_release(bgp->vnihash, vpn);
QOBJ_UNREG(vpn);
Expand Down Expand Up @@ -5062,7 +5062,7 @@ struct evpnes *bgp_evpn_es_new(struct bgp *bgp,
*/
void bgp_evpn_es_free(struct bgp *bgp, struct evpnes *es)
{
list_delete_and_null(&es->vtep_list);
list_delete(&es->vtep_list);
bgp_table_unlock(es->route_table);
bf_release_index(bm->rd_idspace, es->rd_id);
hash_release(bgp->esihash, es);
Expand Down Expand Up @@ -5631,9 +5631,9 @@ void bgp_evpn_cleanup(struct bgp *bgp)
hash_free(bgp->esihash);
bgp->esihash = NULL;

list_delete_and_null(&bgp->vrf_import_rtl);
list_delete_and_null(&bgp->vrf_export_rtl);
list_delete_and_null(&bgp->l2vnis);
list_delete(&bgp->vrf_import_rtl);
list_delete(&bgp->vrf_export_rtl);
list_delete(&bgp->l2vnis);
}

/*
Expand Down
2 changes: 1 addition & 1 deletion bgpd/bgp_evpn_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -4862,7 +4862,7 @@ void bgp_config_write_evpn_info(struct vty *vty, struct bgp *bgp, afi_t afi,
for (ALL_LIST_ELEMENTS_RO(vnilist, ln, data))
write_vni_config(vty, data);

list_delete_and_null(&vnilist);
list_delete(&vnilist);
}

if (bgp->advertise_all_vni)
Expand Down
2 changes: 1 addition & 1 deletion bgpd/bgp_flowspec_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ void route_vty_out_flowspec(struct vty *vty, struct prefix *p,
if (list_began)
vty_out(vty, ")");
vty_out(vty, "\n");
list_delete_and_null(&list_bpm);
list_delete(&list_bpm);
} else
vty_out(vty, "\tnot installed in PBR\n");
}
Expand Down
2 changes: 1 addition & 1 deletion bgpd/bgp_labelpool.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ void bgp_lp_finish(void)
skiplist_free(lp->inuse);
lp->inuse = NULL;

list_delete_and_null(&lp->chunks);
list_delete(&lp->chunks);

while ((lf = LABEL_FIFO_HEAD(lp->requests))) {

Expand Down
2 changes: 1 addition & 1 deletion bgpd/bgp_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ static __attribute__((__noreturn__)) void bgp_exit(int status)
bgp_zebra_destroy();

bf_free(bm->rd_idspace);
list_delete_and_null(&bm->bgp);
list_delete(&bm->bgp);
memset(bm, 0, sizeof(*bm));

frr_fini();
Expand Down
4 changes: 2 additions & 2 deletions bgpd/bgp_nexthop.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ static void bgp_address_hash_free(void *data)
{
struct bgp_addr *addr = data;

list_delete_and_null(&addr->ifp_name_list);
list_delete(&addr->ifp_name_list);
XFREE(MTYPE_BGP_ADDR, addr);
}

Expand Down Expand Up @@ -308,7 +308,7 @@ static void bgp_address_del(struct bgp *bgp, struct connected *ifc,

if (addr->ifp_name_list->count == 0) {
hash_release(bgp->address_hash, addr);
list_delete_and_null(&addr->ifp_name_list);
list_delete(&addr->ifp_name_list);
XFREE(MTYPE_BGP_ADDR, addr);
}
}
Expand Down
2 changes: 1 addition & 1 deletion bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ static void bgp_info_extra_free(struct bgp_info_extra **extra)
bgp_unlock(e->bgp_orig);

if ((*extra)->bgp_fs_pbr)
list_delete_and_null(&((*extra)->bgp_fs_pbr));
list_delete(&((*extra)->bgp_fs_pbr));
XFREE(MTYPE_BGP_ROUTE_EXTRA, *extra);

*extra = NULL;
Expand Down
4 changes: 2 additions & 2 deletions bgpd/bgp_rpki.c
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ static int bgpd_sync_callback(struct thread *thread)
revalidate_bgp_node(bgp_node, afi,
safi);

list_delete_and_null(&matches);
list_delete(&matches);
}
}
}
Expand Down Expand Up @@ -539,7 +539,7 @@ static int bgp_rpki_init(struct thread_master *master)
static int bgp_rpki_fini(void)
{
stop();
list_delete_and_null(&cache_list);
list_delete(&cache_list);

close(rpki_sync_socket_rtr);
close(rpki_sync_socket_bgpd);
Expand Down
2 changes: 1 addition & 1 deletion bgpd/bgp_zebra.c
Original file line number Diff line number Diff line change
Expand Up @@ -1580,7 +1580,7 @@ static void bgp_redist_del(struct bgp *bgp, afi_t afi, uint8_t type,
listnode_delete(bgp->redist[afi][type], red);
XFREE(MTYPE_BGP_REDIST, red);
if (!bgp->redist[afi][type]->count)
list_delete_and_null(&bgp->redist[afi][type]);
list_delete(&bgp->redist[afi][type]);
}
}

Expand Down
14 changes: 7 additions & 7 deletions bgpd/bgpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2426,14 +2426,14 @@ int peer_group_delete(struct peer_group *group)
peer_delete(other);
}
}
list_delete_and_null(&group->peer);
list_delete(&group->peer);

for (afi = AFI_IP; afi < AFI_MAX; afi++) {
for (ALL_LIST_ELEMENTS(group->listen_range[afi], node, nnode,
prefix)) {
prefix_free(prefix);
}
list_delete_and_null(&group->listen_range[afi]);
list_delete(&group->listen_range[afi]);
}

XFREE(MTYPE_PEER_GROUP_HOST, group->name);
Expand Down Expand Up @@ -3221,8 +3221,8 @@ void bgp_free(struct bgp *bgp)

QOBJ_UNREG(bgp);

list_delete_and_null(&bgp->group);
list_delete_and_null(&bgp->peer);
list_delete(&bgp->group);
list_delete(&bgp->peer);

if (bgp->peerhash) {
hash_free(bgp->peerhash);
Expand Down Expand Up @@ -3264,9 +3264,9 @@ void bgp_free(struct bgp *bgp)
vpn_policy_direction_t dir;

if (bgp->vpn_policy[afi].import_vrf)
list_delete_and_null(&bgp->vpn_policy[afi].import_vrf);
list_delete(&bgp->vpn_policy[afi].import_vrf);
if (bgp->vpn_policy[afi].export_vrf)
list_delete_and_null(&bgp->vpn_policy[afi].export_vrf);
list_delete(&bgp->vpn_policy[afi].export_vrf);

dir = BGP_VPN_POLICY_DIR_FROMVPN;
if (bgp->vpn_policy[afi].rtlist[dir])
Expand Down Expand Up @@ -7864,7 +7864,7 @@ void bgp_terminate(void)
bgp_close();

if (bm->listen_sockets)
list_delete_and_null(&bm->listen_sockets);
list_delete(&bm->listen_sockets);

for (ALL_LIST_ELEMENTS(bm->bgp, mnode, mnnode, bgp))
for (ALL_LIST_ELEMENTS(bgp->peer, node, nnode, peer))
Expand Down
14 changes: 7 additions & 7 deletions bgpd/rfapi/bgp_rfapi_cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2290,7 +2290,7 @@ static void bgp_rfapi_delete_nve_group(struct vty *vty, /* NULL = no output */
listnode_delete(rfg->nves, rfd);
listnode_add(orphaned_nves, rfd);
}
list_delete_and_null(&rfg->nves);
list_delete(&rfg->nves);
}

/* delete it */
Expand Down Expand Up @@ -2367,7 +2367,7 @@ static void bgp_rfapi_delete_nve_group(struct vty *vty, /* NULL = no output */
if (vty)
vty_out(vty, "\n");
}
list_delete_and_null(&orphaned_nves);
list_delete(&orphaned_nves);
}
}

Expand Down Expand Up @@ -3395,7 +3395,7 @@ static void bgp_rfapi_delete_l2_group(struct vty *vty, /* NULL = no output */
if (rfg->rt_export_list)
ecommunity_free(&rfg->rt_export_list);
if (rfg->labels)
list_delete_and_null(&rfg->labels);
list_delete(&rfg->labels);
if (rfg->rfp_cfg)
XFREE(MTYPE_RFAPI_RFP_GROUP_CFG, rfg->rfp_cfg);
listnode_delete(bgp->rfapi_cfg->l2_groups, rfg);
Expand Down Expand Up @@ -3809,10 +3809,10 @@ void bgp_rfapi_cfg_destroy(struct bgp *bgp, struct rfapi_cfg *h)
bgp_rfapi_delete_named_nve_group(NULL, bgp, NULL, RFAPI_GROUP_CFG_MAX);
bgp_rfapi_delete_named_l2_group(NULL, bgp, NULL);
if (h->l2_groups != NULL)
list_delete_and_null(&h->l2_groups);
list_delete_and_null(&h->nve_groups_sequential);
list_delete_and_null(&h->rfg_export_direct_bgp_l);
list_delete_and_null(&h->rfg_export_zebra_l);
list_delete(&h->l2_groups);
list_delete(&h->nve_groups_sequential);
list_delete(&h->rfg_export_direct_bgp_l);
list_delete(&h->rfg_export_zebra_l);
if (h->default_rt_export_list)
ecommunity_free(&h->default_rt_export_list);
if (h->default_rt_import_list)
Expand Down
2 changes: 1 addition & 1 deletion bgpd/rfapi/rfapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ void del_vnc_route(struct rfapi_descriptor *rfd,
* Delete local_nexthops list
*/
if (bi->extra && bi->extra->vnc.export.local_nexthops) {
list_delete_and_null(
list_delete(
&bi->extra->vnc.export.local_nexthops);
}

Expand Down
8 changes: 4 additions & 4 deletions bgpd/rfapi/rfapi_rib.c
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ void rfapiRibClear(struct rfapi_descriptor *rfd)
*/
if (pn->info) {
if (pn->info != (void *)1) {
list_delete_and_null(
list_delete(
(struct list *
*)(&pn->info));
}
Expand Down Expand Up @@ -1433,7 +1433,7 @@ static void process_pending_node(struct bgp *bgp, struct rfapi_descriptor *rfd,
}

delete_list->del = (void (*)(void *))rfapi_info_free;
list_delete_and_null(&delete_list);
list_delete(&delete_list);
}

RFAPI_RIB_CHECK_COUNTS(0, 0);
Expand All @@ -1448,7 +1448,7 @@ static void process_pending_node(struct bgp *bgp, struct rfapi_descriptor *rfd,
agg_unlock_node(pn);
}
if (lPendCost) {
list_delete_and_null(&lPendCost);
list_delete(&lPendCost);
pn->info = NULL;
agg_unlock_node(pn);
}
Expand Down Expand Up @@ -1633,7 +1633,7 @@ void rfapiRibUpdatePendingNode(
*/
if (pn->info) {
if (pn->info != (void *)1) {
list_delete_and_null((struct list **)(&pn->info));
list_delete((struct list **)(&pn->info));
}
pn->info = NULL;
agg_unlock_node(pn); /* linklist or 1 deleted */
Expand Down
2 changes: 1 addition & 1 deletion bgpd/rfapi/rfapi_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -3268,7 +3268,7 @@ static int rfapiDeleteLocalPrefixesByRFD(struct rfapi_local_reg_delete_arg *cda,
}
list_delete_all_node(adb_delete_list);
}
list_delete_and_null(&adb_delete_list);
list_delete(&adb_delete_list);
}


Expand Down
2 changes: 1 addition & 1 deletion bgpd/rfapi/vnc_export_bgp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,7 @@ void vnc_direct_bgp_vpn_disable(struct bgp *bgp, afi_t afi)
if (nve_list) {
vnc_direct_bgp_unexport_table(
afi, it->imported_vpn[afi], nve_list);
list_delete_and_null(&nve_list);
list_delete(&nve_list);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion bgpd/rfapi/vnc_import_bgp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2404,7 +2404,7 @@ void vnc_import_bgp_exterior_add_route_interior(
skiplist_delete(it->monitor_exterior_orphans,
an_bi_exterior, NULL);
}
list_delete_and_null(&list_adopted);
list_delete(&list_adopted);
}
}

Expand Down
4 changes: 2 additions & 2 deletions bgpd/rfapi/vnc_zebra.c
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ static void vnc_zebra_add_del_prefix(struct bgp *bgp,
nve_list_to_nh_array(rn->p.family, nves, &nexthop_count,
&nh_ary, &nhp_ary);

list_delete_and_null(&nves);
list_delete(&nves);

if (nexthop_count)
vnc_zebra_route_msg(&rn->p, nexthop_count, nhp_ary,
Expand Down Expand Up @@ -768,7 +768,7 @@ static void vnc_zebra_add_del_group_afi(struct bgp *bgp,
vnc_zlog_debug_verbose("%s: family: %d, nve count: %d",
__func__, family, nexthop_count);

list_delete_and_null(&nves);
list_delete(&nves);

if (nexthop_count) {
/*
Expand Down
2 changes: 1 addition & 1 deletion eigrpd/eigrp_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ void show_ip_eigrp_prefix_entry(struct vty *vty, struct eigrp_prefix_entry *tn)
tn->serno);

if (successors)
list_delete_and_null(&successors);
list_delete(&successors);
}

void show_ip_eigrp_nexthop_entry(struct vty *vty, struct eigrp *eigrp,
Expand Down
14 changes: 7 additions & 7 deletions eigrpd/eigrp_fsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ int eigrp_fsm_event_nq_fcn(struct eigrp_fsm_action_message *msg)
// neighbors left
}

list_delete_and_null(&successors);
list_delete(&successors);

return 1;
}
Expand All @@ -479,7 +479,7 @@ int eigrp_fsm_event_q_fcn(struct eigrp_fsm_action_message *msg)
// neighbors left
}

list_delete_and_null(&successors);
list_delete(&successors);

return 1;
}
Expand Down Expand Up @@ -530,7 +530,7 @@ int eigrp_fsm_event_lr(struct eigrp_fsm_action_message *msg)

ne = listnode_head(successors);
eigrp_send_reply(ne->adv_router, prefix);
list_delete_and_null(&successors);
list_delete(&successors);
}

prefix->state = EIGRP_FSM_STATE_PASSIVE;
Expand Down Expand Up @@ -560,7 +560,7 @@ int eigrp_fsm_event_dinc(struct eigrp_fsm_action_message *msg)
msg);


list_delete_and_null(&successors);
list_delete(&successors);
return 1;
}

Expand All @@ -584,7 +584,7 @@ int eigrp_fsm_event_lr_fcs(struct eigrp_fsm_action_message *msg)
ne = listnode_head(successors);
eigrp_send_reply(ne->adv_router, prefix);

list_delete_and_null(&successors);
list_delete(&successors);
}
prefix->req_action |= EIGRP_FSM_NEED_UPDATE;
listnode_add(eigrp->topology_changes_internalIPV4, prefix);
Expand Down Expand Up @@ -620,7 +620,7 @@ int eigrp_fsm_event_lr_fcn(struct eigrp_fsm_action_message *msg)
// neighbors left
}

list_delete_and_null(&successors);
list_delete(&successors);

return 1;
}
Expand All @@ -636,6 +636,6 @@ int eigrp_fsm_event_qact(struct eigrp_fsm_action_message *msg)
msg->prefix->state = EIGRP_FSM_STATE_ACTIVE_2;
msg->prefix->distance = ne->distance;

list_delete_and_null(&successors);
list_delete(&successors);
return 1;
}
Loading

0 comments on commit 6a154c8

Please sign in to comment.