summaryrefslogtreecommitdiffstats
path: root/ripd
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2018-11-03 00:51:43 +0100
committerRenato Westphal <renato@opensourcerouting.org>2018-11-26 20:35:58 +0100
commit80243aef050c1f882a169b402ff5c50fed63b451 (patch)
tree13886bad2557f36b3e19a40fd7b5d105727faecb /ripd
parentlib: use prefixconstptr instead of const prefixptr (diff)
downloadfrr-80243aef050c1f882a169b402ff5c50fed63b451.tar.xz
frr-80243aef050c1f882a169b402ff5c50fed63b451.zip
lib: don't fetch schema information when creating yang_data structures
Prefetching the schema node when creating yang_data structures is expensive, and in most cases we don't need that information. In that case, fetch the schema information only when necessary to improve performance when fetching operational data. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ripd')
-rw-r--r--ripd/rip_northbound.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/ripd/rip_northbound.c b/ripd/rip_northbound.c
index bb32409a2..f0f6edce8 100644
--- a/ripd/rip_northbound.c
+++ b/ripd/rip_northbound.c
@@ -1023,8 +1023,8 @@ static int ripd_state_neighbors_neighbor_get_keys(const void *list_entry,
const struct rip_peer *peer = listgetdata(node);
keys->num = 1;
- (void)inet_ntop(AF_INET, &peer->addr, keys->key[0].value,
- sizeof(keys->key[0].value));
+ (void)inet_ntop(AF_INET, &peer->addr, keys->key[0],
+ sizeof(keys->key[0]));
return NB_OK;
}
@@ -1034,7 +1034,7 @@ ripd_state_neighbors_neighbor_lookup_entry(const struct yang_list_keys *keys)
{
struct in_addr address;
- yang_str2ipv4(keys->key[0].value, &address);
+ yang_str2ipv4(keys->key[0], &address);
return rip_peer_lookup(&address);
}
@@ -1113,8 +1113,7 @@ static int ripd_state_routes_route_get_keys(const void *list_entry,
const struct route_node *rn = list_entry;
keys->num = 1;
- (void)prefix2str(&rn->p, keys->key[0].value,
- sizeof(keys->key[0].value));
+ (void)prefix2str(&rn->p, keys->key[0], sizeof(keys->key[0]));
return NB_OK;
}
@@ -1125,7 +1124,7 @@ ripd_state_routes_route_lookup_entry(const struct yang_list_keys *keys)
struct prefix prefix;
struct route_node *rn;
- yang_str2ipv4p(keys->key[0].value, &prefix);
+ yang_str2ipv4p(keys->key[0], &prefix);
rn = route_node_lookup(rip->table, &prefix);
if (!rn || !rn->info)