summaryrefslogtreecommitdiffstats
path: root/print-snmp.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:52:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-19 04:52:31 +0000
commit31cd589d20ba8d3d6b3fc4fccacc40d38a163c5d (patch)
tree99d6c086833d530e5d1d33a8128961f8149843f0 /print-snmp.c
parentAdding upstream version 4.99.4. (diff)
downloadtcpdump-ddb52baf9b7e43d90d652aef109200fa63ba0497.tar.xz
tcpdump-ddb52baf9b7e43d90d652aef109200fa63ba0497.zip
Adding upstream version 4.99.5.upstream/4.99.5upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'print-snmp.c')
-rw-r--r--print-snmp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/print-snmp.c b/print-snmp.c
index 6aae34c..76f0bba 100644
--- a/print-snmp.c
+++ b/print-snmp.c
@@ -58,14 +58,13 @@
/* \summary: Simple Network Management Protocol (SNMP) printer */
-#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif
#include "netdissect-stdinc.h"
#include <stdio.h>
#include <string.h>
+#include <limits.h>
#ifdef USE_LIBSMI
#include <smi.h>
@@ -531,7 +530,7 @@ asn1_parse(netdissect_options *ndo,
break;
case INTEGER: {
- int32_t data;
+ uint32_t data;
elem->type = BE_INT;
data = 0;
@@ -540,7 +539,7 @@ asn1_parse(netdissect_options *ndo,
return -1;
}
if (GET_U_1(p) & ASN_BIT8) /* negative */
- data = -1;
+ data = UINT_MAX;
for (i = elem->asnlen; i != 0; p++, i--)
data = (data << ASN_SHIFT8) | GET_U_1(p);
elem->data.integer = data;
@@ -743,7 +742,8 @@ asn1_print(netdissect_options *ndo,
break;
case BE_OID: {
- int o = 0, first = -1;
+ int first = -1;
+ uint32_t o = 0;
p = (const u_char *)elem->data.raw;
i = asnlen;
@@ -1088,7 +1088,7 @@ smi_print_value(netdissect_options *ndo,
}
if (NOTIFY_CLASS(pduid) && smiNode->access < SMI_ACCESS_NOTIFY) {
- ND_PRINT("[notNotifyable]");
+ ND_PRINT("[notNotifiable]");
}
if (READ_CLASS(pduid) && smiNode->access < SMI_ACCESS_READ_ONLY) {