On Wed, 04 Aug 2004 22:42:04 +0100 Richard wrote:
RM> I'm using net-snmp on debian testing version 5.1.1-2 and have run into
RM> the problem referenced below where 64 bit interface counters don't get
RM> handled properly.
RM> 
RM> http://sourceforge.net/mailarchive/message.php?msg_id=7090918

[which contains this patch]

 --- net-snmp-5.0.9.org/agent/mibgroup/mibII/interfaces.c        2004-01-31
21:18:15.000000000 +0100
 +++ net-snmp-5.0.9/agent/mibgroup/mibII/interfaces.c    2004-01-31
01:02:54.000000000 +0100 @@ -1492,12 +1492,12 @@
      struct ifreq    ifrq;
      struct ifnet  **ifnetaddr_ptr;
      FILE           *devin;
 -    unsigned long   rec_pkt, rec_oct, rec_err, rec_drop;
 -    unsigned long   snd_pkt, snd_oct, snd_err, snd_drop, coll;
 +    unsigned long long   rec_pkt, rec_oct, rec_err, rec_drop;
 +    unsigned long long   snd_pkt, snd_oct, snd_err, snd_drop, coll;
      int             i, fd;
      conf_if_list   *if_ptr;
      const char     *scan_line_2_2 =
 -        "%lu %lu %lu %lu %*lu %*lu %*lu %*lu %lu %lu %lu %lu %*lu %lu";
 +        "%llu %llu %llu %llu %*llu %*llu %*llu %*llu %llu %llu %llu %llu
%*llu %llu";      const char     *scan_line_2_0 =

RM> It doesn't seem that the patch mentioned in the message has been applied
RM> and I'm wondering if this is an oversight or whether there are problems
RM> with the patch. If there are problems with it I should have some time
RM> early next week when I could have a go at making a proper fix.

My only concern with the patch is whether or not it breaks any 32 bit
platforms, and if it works for all the various 64 bit platforms. I don't
believe that 'long long' is ANSI C, and that's traditionally our minimum
standard.

One alternative I've thought of would be to use 'uintmax_t' (defined in
stdint.h) as the var type, which should work for 32 and 64 bit, but I'm not
sure what would happen on a 32 bit system when scanf gets a 'llu' and a 32 bit
variable. Haven't had time to investigate.

Anyone else have any insights?

-- 
Robert Story; NET-SNMP Junkie <http://www.net-snmp.org/>
<irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders>

You are lost in a twisty maze of little standards, all different. 


-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
Net-snmp-coders mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to