Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib, ripnd: Isolate aggreagate pointer to using protocol #2715

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bgpd/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ BGP_VNC_RFAPI_HD=rfapi/bgp_rfapi_cfg.h \
rfapi/rfapi_monitor.h \
rfapi/rfapi_private.h \
rfapi/rfapi_rib.h \
rfapi/rfapi_table.h \
rfapi/rfapi_vty.h \
rfapi/vnc_debug.h \
rfapi/vnc_export_bgp.h \
Expand Down
26 changes: 13 additions & 13 deletions bgpd/rfapi/rfapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,11 @@ int rfapi_ip_addr_cmp(struct rfapi_ip_addr *a1, struct rfapi_ip_addr *a2)

static int rfapi_find_node(struct bgp *bgp, struct rfapi_ip_addr *vn_addr,
struct rfapi_ip_addr *un_addr,
struct route_node **node)
struct rfapi_node **node)
{
struct rfapi *h;
struct prefix p;
struct route_node *rn;
struct rfapi_node *rn;
int rc;
afi_t afi;

Expand All @@ -227,12 +227,12 @@ static int rfapi_find_node(struct bgp *bgp, struct rfapi_ip_addr *vn_addr,
if ((rc = rfapiRaddr2Qprefix(un_addr, &p)))
return rc;

rn = route_node_lookup(h->un[afi], &p);
rn = rfapi_route_node_lookup(h->un[afi], &p);

if (!rn)
return ENOENT;

route_unlock_node(rn);
rfapi_unlock_node(rn);

*node = rn;

Expand All @@ -243,7 +243,7 @@ static int rfapi_find_node(struct bgp *bgp, struct rfapi_ip_addr *vn_addr,
int rfapi_find_rfd(struct bgp *bgp, struct rfapi_ip_addr *vn_addr,
struct rfapi_ip_addr *un_addr, struct rfapi_descriptor **rfd)
{
struct route_node *rn;
struct rfapi_node *rn;
int rc;

rc = rfapi_find_node(bgp, vn_addr, un_addr, &rn);
Expand Down Expand Up @@ -1393,7 +1393,7 @@ int rfapi_init_and_open(struct bgp *bgp, struct rfapi_descriptor *rfd,
char buf_un[BUFSIZ];
afi_t afi_vn, afi_un;
struct prefix pfx_un;
struct route_node *rn;
struct rfapi_node *rn;


rfapi_time(&rfd->open_time);
Expand Down Expand Up @@ -1422,7 +1422,7 @@ int rfapi_init_and_open(struct bgp *bgp, struct rfapi_descriptor *rfd,
assert(afi_vn && afi_un);
assert(!rfapiRaddr2Qprefix(&rfd->un_addr, &pfx_un));

rn = route_node_get(h->un[afi_un], &pfx_un);
rn = rfapi_route_node_get(h->un[afi_un], &pfx_un);
assert(rn);
rfd->next = rn->info;
rn->info = rfd;
Expand Down Expand Up @@ -1534,7 +1534,7 @@ rfapi_query_inner(void *handle, struct rfapi_ip_addr *target,
afi_t afi;
struct prefix p;
struct prefix p_original;
struct route_node *rn;
struct rfapi_node *rn;
struct rfapi_descriptor *rfd = (struct rfapi_descriptor *)handle;
struct bgp *bgp = rfd->bgp;
struct rfapi_next_hop_entry *pNHE = NULL;
Expand Down Expand Up @@ -1703,7 +1703,7 @@ rfapi_query_inner(void *handle, struct rfapi_ip_addr *target,
}

if (rn) {
route_lock_node(rn); /* so we can unlock below */
rfapi_lock_node(rn); /* so we can unlock below */
} else {
/*
* returns locked node. Don't unlock yet because the
Expand All @@ -1720,7 +1720,7 @@ rfapi_query_inner(void *handle, struct rfapi_ip_addr *target,

assert(rn);
if (!rn->info) {
route_unlock_node(rn);
rfapi_unlock_node(rn);
vnc_zlog_debug_verbose(
"%s: VPN route not found, returning ENOENT", __func__);
return ENOENT;
Expand Down Expand Up @@ -1757,7 +1757,7 @@ rfapi_query_inner(void *handle, struct rfapi_ip_addr *target,
&p_original);
}

route_unlock_node(rn);
rfapi_unlock_node(rn);

done:
if (ppNextHopEntry) {
Expand Down Expand Up @@ -2169,7 +2169,7 @@ int rfapi_close(void *handle)
{
struct rfapi_descriptor *rfd = (struct rfapi_descriptor *)handle;
int rc;
struct route_node *node;
struct rfapi_node *node;
struct bgp *bgp;
struct rfapi *h;

Expand Down Expand Up @@ -2275,7 +2275,7 @@ int rfapi_close(void *handle)
}
}
}
route_unlock_node(node);
rfapi_unlock_node(node);
}

/*
Expand Down
Loading