summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.sbin/snmpd/smi.c7
-rw-r--r--usr.sbin/snmpd/snmpd.h4
2 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/snmpd/smi.c b/usr.sbin/snmpd/smi.c
index da20de7d414..28fc6f9cb75 100644
--- a/usr.sbin/snmpd/smi.c
+++ b/usr.sbin/snmpd/smi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smi.c,v 1.2 2007/12/29 09:24:43 reyk Exp $ */
+/* $OpenBSD: smi.c,v 1.3 2008/01/02 20:54:59 maja Exp $ */
/*
* Copyright (c) 2007 Reyk Floeter <reyk@vantronix.net>
@@ -212,7 +212,7 @@ smi_foreach(struct oid *oid, u_int flags)
return (oid);
}
-long
+int
smi_oid_cmp(struct oid *a, struct oid *b)
{
size_t i;
@@ -226,7 +226,8 @@ smi_oid_cmp(struct oid *a, struct oid *b)
* (it will match any sub-elements)
*/
if ((b->o_flags & OID_TABLE) &&
- (a->o_flags & OID_KEY) == 0)
+ (a->o_flags & OID_KEY) == 0 &&
+ (a->o_oidlen > b->o_oidlen))
return (0);
return (a->o_oidlen - b->o_oidlen);
diff --git a/usr.sbin/snmpd/snmpd.h b/usr.sbin/snmpd/snmpd.h
index 6d4c7c8fb4a..989653e8091 100644
--- a/usr.sbin/snmpd/snmpd.h
+++ b/usr.sbin/snmpd/snmpd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: snmpd.h,v 1.8 2007/12/29 09:24:43 reyk Exp $ */
+/* $OpenBSD: snmpd.h,v 1.9 2008/01/02 20:54:59 maja Exp $ */
/*
* Copyright (c) 2007 Reyk Floeter <reyk@vantronix.net>
@@ -418,6 +418,6 @@ void smi_oidlen(struct ber_oid *);
char *smi_oidstring(struct ber_oid *, char *, size_t);
void smi_delete(struct oid *);
void smi_insert(struct oid *);
-long smi_oid_cmp(struct oid *, struct oid *);
+int smi_oid_cmp(struct oid *, struct oid *);
#endif /* _SNMPD_H */