summaryrefslogtreecommitdiff
path: root/ripd/rip_snmp.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2019-01-04 19:08:10 -0200
committerRenato Westphal <renato@opensourcerouting.org>2019-01-18 16:15:41 -0200
commitc08a21077faa595a76f87cc4b67d76623f045e0f (patch)
tree59bd6b3dd713f05e72e44478bb0426b5b061bd29 /ripd/rip_snmp.c
parent241987a816b8a2bb1d2973f33624fdea62718208 (diff)
ripd: move global counters to the rip structure
The only sideeffect of this change is that these counters will be reset when RIP is deconfigured and then configured again, but this shouldn't be a problem as the RIP MIB isn't specific about this. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'ripd/rip_snmp.c')
-rw-r--r--ripd/rip_snmp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ripd/rip_snmp.c b/ripd/rip_snmp.c
index 9acc825c0a..54c8a2eb8c 100644
--- a/ripd/rip_snmp.c
+++ b/ripd/rip_snmp.c
@@ -160,13 +160,16 @@ static uint8_t *rip2Globals(struct variable *v, oid name[], size_t *length,
== MATCH_FAILED)
return NULL;
+ if (!rip)
+ return NULL;
+
/* Retrun global counter. */
switch (v->magic) {
case RIP2GLOBALROUTECHANGES:
- return SNMP_INTEGER(rip_global_route_changes);
+ return SNMP_INTEGER(rip->counters.route_changes);
break;
case RIP2GLOBALQUERIES:
- return SNMP_INTEGER(rip_global_queries);
+ return SNMP_INTEGER(rip->counters.queries);
break;
default:
return NULL;