snmp_set_var_value() and 64bit integer truncation

"Brian A. Seklecki" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <1225111974.10442.36.camel@soundwave.ws.pitbpa0.priv.collaborativefusion.com>
Re-send (For some reason this never made it)

--

All:

Does this 32bit integer truncate error have to be LOG_ERR?

snmp_set_var_value()
[...snip...]
#if SIZEOF_LONG != SIZEOF_INT
            else if (vars->val_len == sizeof(long)){
                const u_long   *val_ulong
                    = (const u_long *) value;
                *(vars->val.integer) = *val_ulong;
                if (*(vars->val.integer) > 0xffffffff) {
               snmp_log(LOG_ERR,"truncating integer value > 32 bits\n");
                    *(vars->val.integer) &= 0xffffffff;
                }
            }
#endif

Also, what's with this pre-processor statement?  I haven't followed the
64-bit train (I assumed that everything had been fixed cira 2000)

On RELENG_7/amd64:

  checking size of long... 8
  checking size of int... 4
  [...snip..]

In the mean time, can we silence it with:

$ more /usr/ports/net-mgmt/net-snmp/files/patch-snmplib_snmpclient32.c 

--- snmplib/snmp_client.c.orig  2008-10-22 11:04:41.00000[Wed Oct 22 @
11:17 AM] seklecki@cauldron-fb0000 -0400
+++ snmplib/snmp_client.c       2008-10-22 11:05:39.000000000 -0400
@@ -802,7 +802,7 @@
                     = (const u_long *) value;
                 *(vars->val.integer) = *val_ulong;
                 if (*(vars->val.integer) > 0xffffffff) {
-                    snmp_log(LOG_ERR,"truncating integer value > 32
bits\n");
+                    /* snmp_log(LOG_ERR,"truncating integer value > 32
bits\n"); */
                     *(vars->val.integer) &= 0xffffffff;
                 }
             }


-- 
Brian A. Seklecki <[email protected]>
Collaborative Fusion, Inc.


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.