Latest version of Fedora net-snmp has the following patch which fixes
this issue ... 

Radek

On Wed, 2005-04-20 at 10:26 +0800, LIAO, GUANGDENG wrote:
> Hi all,
> When I run the command line : snmptable -v1 -c test localhost
> ip.ipAddrTableon 64bit machine, the result is :Timeout: No response from
> localhost. The snmpd is running and configuration file is ok.
> 
> When I try to dig out it, I find the problem is caused in asn_build_int
> which build the 32 bit integer into 64 bit long on 64 bit machine.
> The error information in /var/log/snmp.log is : send response: Error
> building ASN.1 representation (build int size 4: s/b 8).
> 
> In addition, when I used grep to check the places calling asn_build_int,
> I can not find any wrong point. So who is the root evil calling this
> function?
> 
> Could u give me help? Any suggestion?
> 
> 
> Thanks
> Danny
> 
> 
> -------------------------------------------------------
> This SF.Net email is sponsored by: New Crystal Reports XI.
> Version 11 adds new functionality designed to reduce time involved in
> creating, integrating, and deploying reporting solutions. Free runtime info,
> new features, or free trial, at: http://www.businessobjects.com/devxi/728
> _______________________________________________
> 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
-- 
Radek VokÃl <[EMAIL PROTECTED]>
--- net-snmp-5.1.2/snmplib/snmp_api.c.ASN-unsigned64	2004-06-21 12:02:15.000000000 +0200
+++ net-snmp-5.1.2/snmplib/snmp_api.c	2005-02-15 18:13:50.694158600 +0100
@@ -6267,6 +6267,23 @@
     vars->val_len = len;
     switch (type) {
     case ASN_INTEGER:
+        if (value) {
+            if (largeval) {
+                snmp_log(LOG_ERR,"bad size for integer-like type (%d)\n",
+                         vars->val_len);
+                snmp_free_var(vars);
+                return (0);
+            } else if (vars->val_len == sizeof(int)) {
+                val_int = (const int *) value;
+                *(vars->val.integer) = (long) *val_int;
+            } else {
+                val_long = (const long *) value;
+                *(vars->val.integer) = *val_long;
+            }
+        }
+        vars->val_len = sizeof(long);
+        break;
+
     case ASN_UNSIGNED:
     case ASN_TIMETICKS:
     case ASN_IPADDRESS:
@@ -6279,7 +6296,7 @@
                 return (0);
             } else if (vars->val_len == sizeof(int)) {
                 val_int = (const int *) value;
-                *(vars->val.integer) = (long) *val_int;
+                *(vars->val.integer) = (long) *(const unsigned int *)val_int;
             } else {
                 val_long = (const long *) value;
                 *(vars->val.integer) = *val_long;

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to