Re: [tkined] Compiled MIB Problem Under Linux Alpha

From: Bill Fenner (fenner@research.att.com)
Date: Thu May 24 2001 - 17:58:58 MET DST


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;
 
     /*

--
!! 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