From 6b1e37f8537fa2a4560de32e83ca5089763e2d39 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Tue, 22 May 2012 22:15:20 +0200 Subject: build: only define HAVE_SNMP NetSNMP is the only SNMP implementation for Quagga. We don't need two different symbols. --- ospf6d/ospf6_snmp.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'ospf6d/ospf6_snmp.c') diff --git a/ospf6d/ospf6_snmp.c b/ospf6d/ospf6_snmp.c index 5ac7846d..11b733b8 100644 --- a/ospf6d/ospf6_snmp.c +++ b/ospf6d/ospf6_snmp.c @@ -23,14 +23,8 @@ #ifdef HAVE_SNMP -#ifdef HAVE_NETSNMP #include #include -#else -#include -#include -#include -#endif #include "log.h" #include "vty.h" -- cgit v1.2.1 From 8046ba6ec4d6e87bf8da6563c0f3e5e66c4652b3 Mon Sep 17 00:00:00 2001 From: Vincent Bernat Date: Thu, 31 May 2012 13:30:28 +0200 Subject: snmp: let handlers accept OID from a lesser prefix Most table handlers do not expect to be given an OID whose prefix is outside what they can handle. This is not a problem with the SMUX implementation since it always correct the OID such that the prefix matches. However, this is not the case for the AgentX implementation. A new function, smux_header_table() is used to do this normalization. --- ospf6d/ospf6_snmp.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ospf6d/ospf6_snmp.c') diff --git a/ospf6d/ospf6_snmp.c b/ospf6d/ospf6_snmp.c index 11b733b8..d252f549 100644 --- a/ospf6d/ospf6_snmp.c +++ b/ospf6d/ospf6_snmp.c @@ -306,6 +306,10 @@ ospfv3AreaEntry (struct variable *v, oid *name, size_t *length, if (ospf6 == NULL) return NULL; + if (smux_header_table(v, name, length, exact, var_len, write_method) + == MATCH_FAILED) + return NULL; + len = *length - v->namelen; len = (len >= sizeof (u_int32_t) ? sizeof (u_int32_t) : 0); if (exact && len != sizeof (u_int32_t)) @@ -372,6 +376,10 @@ ospfv3AreaLsdbEntry (struct variable *v, oid *name, size_t *length, struct ospf6_area *oa; struct listnode *node; + if (smux_header_table(v, name, length, exact, var_len, write_method) + == MATCH_FAILED) + return NULL; + memset (&area_id, 0, sizeof (struct in_addr)); type = 0; memset (&id, 0, sizeof (struct in_addr)); -- cgit v1.2.1