RE: [tkined] Compiled MIB Problem Under Linux Alpha

From: Dick Libby (Dick_Libby@digi.com)
Date: Tue May 29 2001 - 17:20:11 MET DST


> -----Original Message-----
> From: Bill Fenner [mailto:fenner@research.att.com]
> Sent: Thursday, May 24, 2001 10:59 AM
> To: schoenw@ibr.cs.tu-bs.de
> Cc: dick_libby@digi.com; tkined@ibr.cs.tu-bs.de
> Subject: Re: [tkined] Compiled MIB Problem Under Linux Alpha
>
>
>
> I looked into this a little; part of the problem is that SaveData()
> writes e.g. numTCs as an int, but TnmMibReadFrozen() reads it as a
> size_t, so on any system where sizeof(size_t) != sizeof(int) things
> will break. Also, things like
>
> size_t poolSize;
> ...
> if (1 != fread((char *) &poolSize, sizeof(int), 1, fp)) {
>
> will break even worse, since size_t may be a 64-bit value but you will
> only read 32 bits into it.
>
> This patch makes frozen MIBs work better, at least on FreeBSD/alpha.
>
> Bill
>
> --- tnmMibFrozen.c.orig Thu May 24 08:04:25 2001
> +++ tnmMibFrozen.c Thu May 24 08:54:34 2001
> @@ -551,13 +551,13 @@
> FILE *fp;
> {
> TnmMibNode *root = NULL;
> - size_t poolSize;
> + int poolSize;
> char *pool;
> - size_t numEnums;
> + int numEnums;
> TnmMibRest *enums = NULL;
> - size_t numTcs;
> + int numTcs;
> TnmMibType *tcs = NULL;
> - size_t numNodes;
> + int numNodes;
> TnmMibNode *nodes;
>
> /*
>
> --

I copied the above fix into tnmMibFrozen.c and the resulting
tnm3.0.0.so was the same as the old one. It seems very likely
that the problem that I'm encountering are similar to what
was fixed with Bill Fenner's fix: The compiled MIB is being
read differently than it was written. I'll look in to it when
I have time.

thanks for all of the responses,
Dick

--
!! This message is brought to you via the `tkined & scotty' mailing list.
!! Please do not reply to this message to unsubscribe. To subscribe or
!! unsubscribe, send a mail message to <tkined-request@ibr.cs.tu-bs.de>.
!! See http://wwwsnmp.cs.utwente.nl/~schoenw/scotty/ for more information.



This archive was generated by hypermail 2b29 : Thu Jan 03 2002 - 14:56:26 MET