diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-07-30 11:40:02 -0400 | 
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-11-16 09:43:35 -0500 | 
| commit | 6f94b685d0480f7ea427ddfd1c603399dd047aa3 (patch) | |
| tree | 0bd62ffb42a51cf9c27efbf5e686a703748e1b2a /bgpd/bgp_table.c | |
| parent | aaafc3216727276a6daf5f2fc5a050b5601e1eb3 (diff) | |
bgpd: Abstract bgp_info retrieving/setting from info pointer
The bgp_info data is stored as a void pointer in `struct bgp_node`.
Abstract retrieval of this data and setting of this data
into functions so that in the future we can move around
what is stored in bgp_node.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'bgpd/bgp_table.c')
| -rw-r--r-- | bgpd/bgp_table.c | 7 | 
1 files changed, 4 insertions, 3 deletions
diff --git a/bgpd/bgp_table.c b/bgpd/bgp_table.c index 728eeaa3a9..0329995224 100644 --- a/bgpd/bgp_table.c +++ b/bgpd/bgp_table.c @@ -156,7 +156,8 @@ void bgp_table_range_lookup(const struct bgp_table *table, struct prefix *p,  	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;  		} @@ -172,14 +173,14 @@ void bgp_table_range_lookup(const struct bgp_table *table, struct prefix *p,  	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);  			}  | 
