Resolves: RHEL-13597 - log once truncating issue
This commit is contained in:
parent
7bacfaa497
commit
eaddc6108f
48
net-snmp-5.8-truncating-log-once.patch
Normal file
48
net-snmp-5.8-truncating-log-once.patch
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
From 7330e3e3e08d9baff23332e764f9a53561939fff Mon Sep 17 00:00:00 2001
|
||||||
|
From: Bart Van Assche <bvanassche@acm.org>
|
||||||
|
Date: Thu, 2 Sep 2021 21:06:54 -0700
|
||||||
|
Subject: [PATCH] libsnmp: Log "Truncating integer value >32 bits" once
|
||||||
|
|
||||||
|
Log this message once instead of every time sysUpTime and/or
|
||||||
|
hrSystemUptime are accessed after snmpd is running for more than 497 days.
|
||||||
|
|
||||||
|
Fixes: https://github.com/net-snmp/net-snmp/issues/144
|
||||||
|
---
|
||||||
|
snmplib/snmp_client.c | 9 ++++++---
|
||||||
|
1 file changed, 6 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/snmplib/snmp_client.c b/snmplib/snmp_client.c
|
||||||
|
index 0f539c63fe..b00670d973 100644
|
||||||
|
--- a/snmplib/snmp_client.c
|
||||||
|
+++ b/snmplib/snmp_client.c
|
||||||
|
@@ -853,7 +853,8 @@ snmp_set_var_value(netsnmp_variable_list * vars,
|
||||||
|
= (const u_long *) value;
|
||||||
|
*(vars->val.integer) = *val_ulong;
|
||||||
|
if (*(vars->val.integer) > 0xffffffff) {
|
||||||
|
- snmp_log(LOG_ERR,"truncating integer value > 32 bits\n");
|
||||||
|
+ NETSNMP_LOGONCE((LOG_INFO,
|
||||||
|
+ "truncating integer value > 32 bits\n"));
|
||||||
|
*(vars->val.integer) &= 0xffffffff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -865,7 +866,8 @@ snmp_set_var_value(netsnmp_variable_list * vars,
|
||||||
|
= (const unsigned long long *) value;
|
||||||
|
*(vars->val.integer) = (long) *val_ullong;
|
||||||
|
if (*(vars->val.integer) > 0xffffffff) {
|
||||||
|
- snmp_log(LOG_ERR,"truncating integer value > 32 bits\n");
|
||||||
|
+ NETSNMP_LOGONCE((LOG_INFO,
|
||||||
|
+ "truncating integer value > 32 bits\n"));
|
||||||
|
*(vars->val.integer) &= 0xffffffff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -877,7 +879,8 @@ snmp_set_var_value(netsnmp_variable_list * vars,
|
||||||
|
= (const uintmax_t *) value;
|
||||||
|
*(vars->val.integer) = (long) *val_uintmax_t;
|
||||||
|
if (*(vars->val.integer) > 0xffffffff) {
|
||||||
|
- snmp_log(LOG_ERR,"truncating integer value > 32 bits\n");
|
||||||
|
+ NETSNMP_LOGONCE((LOG_INFO,
|
||||||
|
+ "truncating integer value > 32 bits\n"));
|
||||||
|
*(vars->val.integer) &= 0xffffffff;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user