diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-07-30 17:40:02 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2018-11-16 15:43:35 +0100 |
commit | 6f94b685d0480f7ea427ddfd1c603399dd047aa3 (patch) | |
tree | 0bd62ffb42a51cf9c27efbf5e686a703748e1b2a /bgpd/bgp_table.c | |
parent | bgpd: Reduce size of 'struct bgp_node' by 8 bytes (diff) | |
download | frr-6f94b685d0480f7ea427ddfd1c603399dd047aa3.tar.xz frr-6f94b685d0480f7ea427ddfd1c603399dd047aa3.zip |
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 728eeaa3a..032999522 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); } |