#include "bgpd/bgpd.h"
#include "bgpd/bgp_table.h"
+#include "bgp_addpath.h"
void bgp_table_lock(struct bgp_table *rt)
{
{
struct bgp_node *node;
node = XCALLOC(MTYPE_BGP_NODE, sizeof(struct bgp_node));
+
+ RB_INIT(bgp_adj_out_rb, &node->adj_out);
return bgp_node_to_rnode(node);
}
struct route_table *table, struct route_node *node)
{
struct bgp_node *bgp_node;
+ struct bgp_table *rt;
bgp_node = bgp_node_from_rnode(node);
+ rt = table->info;
+
+ if (rt->bgp) {
+ bgp_addpath_free_node_data(&rt->bgp->tx_addpath,
+ &bgp_node->tx_addpath,
+ rt->afi, rt->safi);
+ }
+
XFREE(MTYPE_BGP_NODE, bgp_node);
}
while (node && node->p.prefixlen <= p->prefixlen
&& prefix_match(&node->p, p)) {
- if (node->info && node->p.prefixlen == p->prefixlen) {
+ if (bgp_node_has_bgp_path_info_data(node)
+ && node->p.prefixlen == p->prefixlen) {
matched = node;
break;
}
else if (matched == NULL)
matched = node = bgp_node_from_rnode(node->parent);
- if (matched->info) {
+ if (bgp_node_has_bgp_path_info_data(matched)) {
bgp_lock_node(matched);
listnode_add(matches, matched);
}
while ((node = bgp_route_next_until_maxlen(node, matched, maxlen))) {
if (prefix_match(p, &node->p)) {
- if (node->info) {
+ if (bgp_node_has_bgp_path_info_data(node)) {
bgp_lock_node(node);
listnode_add(matches, node);
}