diff options
author | Vincent Bernat <bernat@luffy.cx> | 2012-05-31 13:30:28 +0200 |
---|---|---|
committer | Vincent Bernat <bernat@luffy.cx> | 2012-06-25 19:03:23 +0200 |
commit | 8046ba6ec4d6e87bf8da6563c0f3e5e66c4652b3 (patch) | |
tree | 1b38b2eae4e1cee042f96a42217b14647159bf0f /ripd | |
parent | 0ff4b9c96793898429052de576d8da368e48997e (diff) |
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.
Diffstat (limited to 'ripd')
-rw-r--r-- | ripd/rip_snmp.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ripd/rip_snmp.c b/ripd/rip_snmp.c index 803ac856..090ebfae 100644 --- a/ripd/rip_snmp.c +++ b/ripd/rip_snmp.c @@ -345,6 +345,10 @@ rip2IfStatEntry (struct variable *v, oid name[], size_t *length, static struct in_addr addr; static long valid = SNMP_VALID; + if (smux_header_table(v, name, length, exact, var_len, write_method) + == MATCH_FAILED) + return NULL; + memset (&addr, 0, sizeof (struct in_addr)); /* Lookup interface. */ @@ -448,6 +452,10 @@ rip2IfConfAddress (struct variable *v, oid name[], size_t *length, struct interface *ifp; struct rip_interface *ri; + if (smux_header_table(v, name, length, exact, val_len, write_method) + == MATCH_FAILED) + return NULL; + memset (&addr, 0, sizeof (struct in_addr)); /* Lookup interface. */ @@ -518,6 +526,10 @@ rip2PeerTable (struct variable *v, oid name[], size_t *length, struct rip_peer *peer; + if (smux_header_table(v, name, length, exact, val_len, write_method) + == MATCH_FAILED) + return NULL; + memset (&addr, 0, sizeof (struct in_addr)); /* Lookup interface. */ |