On Mon, Jul 13, 2015 at 10:27 AM, Turbo Fredriksson <tu...@bayour.com>
wrote:

> On Jul 10, 2015, at 11:30 PM, Bill Fenner wrote:
>
> Can you try this patch?
>
> --- a/agent/mibgroup/ucd-snmp/pass_common.c+++ 
> b/agent/mibgroup/ucd-snmp/pass_common.c
> @@ -135,7 +135,7 @@ netsnmp_internal_pass_parse(char * buf,
>          c64.high = (unsigned long)(v64 >> 32);
>          c64.low  = (unsigned long)(v64 & 0xffffffff);
>          *var_len = sizeof(c64);-        vp->type = ASN_INTEGER64;+        
> vp->type = ASN_OPAQUE_I64;
>          return ((unsigned char *) &c64);
>      }
>  #endif
>
> The user that reported the int64 issue on my agent pointed
> out to me that this patch isn't quite right. And not complete…
>
> Since it's checking for a "integer64" in that code, it should
> return a "signed char *", no?
>

No.  As with much code that started as pre-ANSI, net-snmp uses (unsigned
char *) to stand in for (void *).


> And since that and "unsigned" exists, it seems reasonable that
> the code should/could return a "unsigned64" as well...
>
> How about the enclosed patch? Tested with the enclosed
> test script (a modification on the one I found at an earlier
> message - see previous mail in thread):
>
> $ snmpget -uro -v2c -cpublic localhost .1.3.6.1.4.1.22222.42.2.0
> SNMPv2-SMI::enterprises.22222.42.2.0 = Opaque: Int64: 9223372036854775806
> $ snmpget -uro -v2c -cpublic localhost .1.3.6.1.4.1.22222.42.5.0
> SNMPv2-SMI::enterprises.22222.42.5.0 = Gauge32: 4294967294
> $ snmpget -uro -v2c -cpublic localhost .1.3.6.1.4.1.22222.42.6.0
> SNMPv2-SMI::enterprises.22222.42.6.0 = Opaque: UInt64: 18446744073709551614
>
> Although I'm not sure "Gauge32" is correct, but considering that
> it returns the correct value...
>

SMI defines "Unsigned32" and "Gauge32" identically, so without a MIB loaded
to distinguish, the command-line tool just reports Gauge32 since it has no
way to know.

  Bill
------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to