X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/b6a3595a5558f48f89ef75ca63d70b240835d1b7..a890c4489fa1bcee9f455ee28d772bb1ccf590bf:/print-snmp.c?ds=sidebyside diff --git a/print-snmp.c b/print-snmp.c index f38fff70..f5501582 100644 --- a/print-snmp.c +++ b/print-snmp.c @@ -66,7 +66,7 @@ #include #include -#ifdef HAVE_SMI_H +#ifdef USE_LIBSMI #include #endif @@ -867,7 +867,7 @@ asn1_decode(u_char *p, u_int length) } #endif -#ifdef LIBSMI +#ifdef USE_LIBSMI struct smi2be { SmiBasetype basetype; @@ -914,11 +914,10 @@ smi_decode_oid(netdissect_options *ndo, first = 0; firstval = o / OIDMUX; if (firstval > 2) firstval = 2; + o -= firstval * OIDMUX; if (*oidlen < oidsize) { - oid[*oidlen] = firstval; + oid[(*oidlen)++] = firstval; } - o -= firstval * OIDMUX; - if (*oidlen < oidsize) (*oidlen)++; } if (*oidlen < oidsize) { oid[(*oidlen)++] = o; @@ -1201,7 +1200,7 @@ varbind_print(netdissect_options *ndo, { struct be elem; int count = 0, ind; -#ifdef LIBSMI +#ifdef USE_LIBSMI SmiNode *smiNode = NULL; #endif int status; @@ -1248,7 +1247,7 @@ varbind_print(netdissect_options *ndo, asn1_print(ndo, &elem); return; } -#ifdef LIBSMI +#ifdef USE_LIBSMI smiNode = smi_print_variable(ndo, &elem, &status); #else status = asn1_print(ndo, &elem); @@ -1274,7 +1273,7 @@ varbind_print(netdissect_options *ndo, } } else { if (elem.type != BE_NULL) { -#ifdef LIBSMI +#ifdef USE_LIBSMI status = smi_print_value(ndo, smiNode, pduid, &elem); #else status = asn1_print(ndo, &elem);