[prev in list] [next in list] [prev in thread] [next in thread]
List: net-snmp-bugs
Subject: [ net-snmp-Bugs-659916 ] asn1 module has bug on freebsd/alpha
From: "SourceForge.net" <noreply () sourceforge ! net>
Date: 2004-02-28 0:44:31
Message-ID: E1Awsal-0006oe-00 () sc8-sf-web4 ! sourceforge ! net
[Download RAW message or body]
Bugs item #659916, was opened at 2002-12-30 03:22
Message generated for change (Settings changed) made by slif
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112694&aid=659916&group_id=12694
Category: library
Group: None
Status: Open
Resolution: None
Priority: 9
Submitted By: Nobody/Anonymous (nobody)
>Assigned to: Nobody/Anonymous (nobody)
Summary: asn1 module has bug on freebsd/alpha
Initial Comment:
i was getting 5-octet counters in the asn1 encoding
when running snmpd on freebsd/alpha. it turns out that
sizeof(int) != sizeof(long) and that ifi_ibytes and its
friends and relations are all u_long there. upon
investigation the fix does not require #ifdef's, and so
is probably a general issue with the code. here's what
i run on f.root-servers.net. i am paul@vix.com but i
forgot my sourceforge password.
--- asn1.c.orig Mon Aug 5 06:16:25 2002
+++ asn1.c Mon Aug 5 07:03:25 2002
@@ -453,7 +453,7 @@
_asn_size_err(errpre, intsize, sizeof(long));
return NULL;
}
- integer = *intp;
+ integer = *intp & 0xFFFFFFFF;
mask = ((u_long) 0xFF) << (8 * (sizeof(long) - 1));
/*
* mask is 0xFF000000 on a big-endian machine
@@ -474,7 +474,7 @@
/*
* mask is 0xFF800000 on a big-endian machine
*/
- while ((((integer & mask) == 0) || ((integer &
mask) == mask))
+ while ((((integer & mask) == 0))
&& intsize > 1) {
intsize--;
integer <<= 8;
@@ -498,7 +498,8 @@
integer <<= 8;
}
DEBUGDUMPSETUP("send", initdatap, data - initdatap);
- DEBUGMSG(("dumpv_send", " UInteger:\t%ld
(0x%.2X)\n", *intp, *intp));
+ integer = *intp & 0xFFFFFFFF;
+ DEBUGMSG(("dumpv_send", " UInteger:\t%ld
(0x%.2X)\n", integer, integer));
return data;
}
@@ -2342,7 +2343,7 @@
u_char type, u_long *
intp, size_t intsize)
{
static const char *errpre = "build uint";
- register u_long integer = *intp;
+ register u_long integer = *intp & 0xFFFFFFFF;
size_t start_offset = *offset;
if (intsize != sizeof(unsigned long)) {
@@ -2385,8 +2386,9 @@
} else {
DEBUGDUMPSETUP("send", (*pkt + *pkt_len -
*offset),
(*offset - start_offset));
- DEBUGMSG(("dumpv_send", " UInteger:\t%lu
(0x%.2X)\n", *intp,
- *intp));
+ integer = *intp & 0xFFFFFFFF;
+ DEBUGMSG(("dumpv_send", " UInteger:\t%lu
(0x%.2X)\n", integer,
+ integer));
return 1;
}
}
----------------------------------------------------------------------
Comment By: Michael J. Slifcak (slif)
Date: 2004-02-27 16:05
Message:
Logged In: YES
user_id=88697
reminder sent to submitter that newer version (probably)
addressed this problem.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112694&aid=659916&group_id=12694
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Net-snmp-bugs mailing list
Net-snmp-bugs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-bugs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic