mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-11-02 13:09:36 +00:00
bgpd: Cleanup bgp_nexthop_set|get function names
The bgp_nexthop_set_node_info and bgp_nexthop_get_node_info function names were slightly backwards, rename to bgp_node_set and get Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
e13cc80578
commit
5b8d32bd58
@ -81,7 +81,7 @@ static void bgp_nexthop_cache_reset(struct bgp_table *table)
|
||||
struct bgp_nexthop_cache *bnc;
|
||||
|
||||
for (rn = bgp_table_top(table); rn; rn = bgp_route_next(rn)) {
|
||||
bnc = bgp_nexthop_get_node_info(rn);
|
||||
bnc = bgp_node_get_bgp_nexthop_info(rn);
|
||||
if (!bnc)
|
||||
continue;
|
||||
|
||||
@ -92,7 +92,7 @@ static void bgp_nexthop_cache_reset(struct bgp_table *table)
|
||||
}
|
||||
|
||||
bnc_free(bnc);
|
||||
bgp_nexthop_set_node_info(rn, NULL);
|
||||
bgp_node_set_bgp_nexthop_info(rn, NULL);
|
||||
bgp_unlock_node(rn);
|
||||
}
|
||||
}
|
||||
@ -601,7 +601,7 @@ static void bgp_show_nexthops(struct vty *vty, struct bgp *bgp, int detail)
|
||||
|
||||
for (rn = bgp_table_top(bgp->nexthop_cache_table[afi]); rn;
|
||||
rn = bgp_route_next(rn)) {
|
||||
bnc = bgp_nexthop_get_node_info(rn);
|
||||
bnc = bgp_node_get_bgp_nexthop_info(rn);
|
||||
if (!bnc)
|
||||
continue;
|
||||
|
||||
|
||||
@ -95,7 +95,7 @@ static void bgp_unlink_nexthop_check(struct bgp_nexthop_cache *bnc)
|
||||
}
|
||||
unregister_zebra_rnh(bnc,
|
||||
CHECK_FLAG(bnc->flags, BGP_STATIC_ROUTE));
|
||||
bgp_nexthop_set_node_info(bnc->node, NULL);
|
||||
bgp_node_set_bgp_nexthop_info(bnc->node, NULL);
|
||||
bgp_unlock_node(bnc->node);
|
||||
bnc->node = NULL;
|
||||
bnc_free(bnc);
|
||||
@ -126,7 +126,7 @@ void bgp_unlink_nexthop_by_peer(struct peer *peer)
|
||||
|
||||
rn = bgp_node_get(peer->bgp->nexthop_cache_table[afi], &p);
|
||||
|
||||
bnc = bgp_nexthop_get_node_info(rn);
|
||||
bnc = bgp_node_get_bgp_nexthop_info(rn);
|
||||
if (!bnc)
|
||||
return;
|
||||
|
||||
@ -183,10 +183,10 @@ int bgp_find_or_add_nexthop(struct bgp *bgp_route, struct bgp *bgp_nexthop,
|
||||
else
|
||||
rn = bgp_node_get(bgp_nexthop->nexthop_cache_table[afi], &p);
|
||||
|
||||
bnc = bgp_nexthop_get_node_info(rn);
|
||||
bnc = bgp_node_get_bgp_nexthop_info(rn);
|
||||
if (!bnc) {
|
||||
bnc = bnc_new();
|
||||
bgp_nexthop_set_node_info(rn, bnc);
|
||||
bgp_node_set_bgp_nexthop_info(rn, bnc);
|
||||
bnc->node = rn;
|
||||
bnc->bgp = bgp_nexthop;
|
||||
bgp_lock_node(rn);
|
||||
@ -293,7 +293,7 @@ void bgp_delete_connected_nexthop(afi_t afi, struct peer *peer)
|
||||
return;
|
||||
}
|
||||
|
||||
bnc = bgp_nexthop_get_node_info(rn);
|
||||
bnc = bgp_node_get_bgp_nexthop_info(rn);
|
||||
if (!bnc) {
|
||||
if (BGP_DEBUG(nht, NHT))
|
||||
zlog_debug("Cannot find connected NHT node for peer %s on route_node as expected",
|
||||
@ -318,7 +318,7 @@ void bgp_delete_connected_nexthop(afi_t afi, struct peer *peer)
|
||||
zlog_debug("Freeing connected NHT node %p for peer %s",
|
||||
bnc, peer->host);
|
||||
unregister_zebra_rnh(bnc, 0);
|
||||
bgp_nexthop_set_node_info(bnc->node, NULL);
|
||||
bgp_node_set_bgp_nexthop_info(bnc->node, NULL);
|
||||
bgp_unlock_node(bnc->node);
|
||||
bnc_free(bnc);
|
||||
}
|
||||
@ -371,7 +371,7 @@ void bgp_parse_nexthop_update(int command, vrf_id_t vrf_id)
|
||||
return;
|
||||
}
|
||||
|
||||
bnc = bgp_nexthop_get_node_info(rn);
|
||||
bnc = bgp_node_get_bgp_nexthop_info(rn);
|
||||
if (!bnc) {
|
||||
if (BGP_DEBUG(nht, NHT)) {
|
||||
char buf[PREFIX2STR_BUFFER];
|
||||
@ -510,7 +510,7 @@ void bgp_cleanup_nexthops(struct bgp *bgp)
|
||||
|
||||
for (rn = bgp_table_top(bgp->nexthop_cache_table[afi]); rn;
|
||||
rn = bgp_route_next(rn)) {
|
||||
bnc = bgp_nexthop_get_node_info(rn);
|
||||
bnc = bgp_node_get_bgp_nexthop_info(rn);
|
||||
if (!bnc)
|
||||
continue;
|
||||
|
||||
@ -829,7 +829,7 @@ void bgp_nht_register_nexthops(struct bgp *bgp)
|
||||
|
||||
for (rn = bgp_table_top(bgp->nexthop_cache_table[afi]); rn;
|
||||
rn = bgp_route_next(rn)) {
|
||||
bnc = bgp_nexthop_get_node_info(rn);
|
||||
bnc = bgp_node_get_bgp_nexthop_info(rn);
|
||||
|
||||
if (!bnc)
|
||||
continue;
|
||||
@ -867,7 +867,7 @@ void bgp_nht_register_enhe_capability_interfaces(struct peer *peer)
|
||||
return;
|
||||
rn = bgp_node_lookup(bgp->nexthop_cache_table[AFI_IP6], &p);
|
||||
|
||||
bnc = bgp_nexthop_get_node_info(rn);
|
||||
bnc = bgp_node_get_bgp_nexthop_info(rn);
|
||||
if (!bnc)
|
||||
return;
|
||||
|
||||
|
||||
@ -365,12 +365,12 @@ static inline void bgp_connected_set_node_info(struct bgp_node *node,
|
||||
}
|
||||
|
||||
static inline struct bgp_nexthop_cache *
|
||||
bgp_nexthop_get_node_info(struct bgp_node *node)
|
||||
bgp_node_get_bgp_nexthop_info(struct bgp_node *node)
|
||||
{
|
||||
return node->info;
|
||||
}
|
||||
|
||||
static inline void bgp_nexthop_set_node_info(struct bgp_node *node,
|
||||
static inline void bgp_node_set_bgp_nexthop_info(struct bgp_node *node,
|
||||
struct bgp_nexthop_cache *bnc)
|
||||
{
|
||||
node->info = bnc;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user