36d59937b3
Resolves: #640848
52 lines
1.9 KiB
Diff
52 lines
1.9 KiB
Diff
640848: snmpd always returns an incorrect sysObjectID of ".1.3" or ".0.1"
|
|
|
|
Source: upstream, SVN rev. 19322
|
|
|
|
Index: net-snmp/agent/mibgroup/mibII/system_mib.c
|
|
===================================================================
|
|
--- net-snmp/agent/mibgroup/mibII/system_mib.c (revision 17596)
|
|
+++ net-snmp/agent/mibgroup/mibII/system_mib.c (working copy)
|
|
@@ -60,7 +57,7 @@
|
|
static char sysName[SYS_STRING_LEN] = NETSNMP_SYS_NAME;
|
|
static char sysLocation[SYS_STRING_LEN] = NETSNMP_SYS_LOC;
|
|
static oid sysObjectID[MAX_OID_LEN];
|
|
-static size_t sysObjectIDLength;
|
|
+static size_t sysObjectIDByteLength;
|
|
|
|
extern oid version_sysoid[];
|
|
extern int version_sysoid_len;
|
|
@@ -171,12 +168,11 @@
|
|
static void
|
|
system_parse_config_sysObjectID(const char *token, char *cptr)
|
|
{
|
|
- sysObjectIDLength = MAX_OID_LEN;
|
|
+ size_t sysObjectIDLength = MAX_OID_LEN;
|
|
if (!read_objid(cptr, sysObjectID, &sysObjectIDLength)) {
|
|
netsnmp_config_error("sysobjectid token not a parsable OID:\n\t%s",
|
|
cptr);
|
|
memcpy(sysObjectID, version_sysoid, version_sysoid_len * sizeof(oid));
|
|
- sysObjectIDLength = version_sysoid_len;
|
|
}
|
|
}
|
|
|
|
@@ -318,7 +314,7 @@
|
|
|
|
/* default sysObjectID */
|
|
memcpy(sysObjectID, version_sysoid, version_sysoid_len * sizeof(oid));
|
|
- sysObjectIDLength = version_sysoid_len;
|
|
+ sysObjectIDByteLength = version_sysoid_len * sizeof(oid);
|
|
|
|
{
|
|
const oid sysDescr_oid[] = { 1, 3, 6, 1, 2, 1, 1, 1 };
|
|
@@ -340,8 +336,8 @@
|
|
HANDLER_CAN_RONLY),
|
|
netsnmp_init_watcher_info6(
|
|
&sysObjectID_winfo, sysObjectID, 0, ASN_OBJECT_ID,
|
|
- WATCHER_MAX_SIZE | WATCHER_SIZE_IS_PTR,
|
|
- MAX_OID_LEN, &sysObjectIDLength));
|
|
+ WATCHER_MAX_SIZE | WATCHER_SIZE_IS_PTR,
|
|
+ MAX_OID_LEN, &sysObjectIDByteLength));
|
|
}
|
|
{
|
|
const oid sysUpTime_oid[] = { 1, 3, 6, 1, 2, 1, 1, 3 };
|