pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/net-snmp Fix a crapload of 64 bit inconsistencies ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/eccbebbf5650
branches:  trunk
changeset: 518710:eccbebbf5650
user:      christos <christos%pkgsrc.org@localhost>
date:      Fri Sep 15 20:13:53 2006 +0000

description:
Fix a crapload of 64 bit inconsistencies (int <-> ptr, int * <-> size_t *)
This now has a chance to work on sparc64.

diffstat:

 net/net-snmp/distinfo         |    3 +-
 net/net-snmp/patches/patch-ea |  454 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 456 insertions(+), 1 deletions(-)

diffs (truncated from 473 to 300 lines):

diff -r 0e05c5856f7a -r eccbebbf5650 net/net-snmp/distinfo
--- a/net/net-snmp/distinfo     Fri Sep 15 17:09:22 2006 +0000
+++ b/net/net-snmp/distinfo     Fri Sep 15 20:13:53 2006 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.28 2006/08/22 14:06:32 joerg Exp $
+$NetBSD: distinfo,v 1.29 2006/09/15 20:13:53 christos Exp $
 
 SHA1 (net-snmp-5.3.1.tar.gz) = 8ddb5122769814f04a7d3d352dcc640df7c89d41
 RMD160 (net-snmp-5.3.1.tar.gz) = 7bcdd213fb2517d0927b030deab5146522b58b3d
@@ -32,4 +32,5 @@
 SHA1 (patch-dr) = ab75e5cf3448d9c0520b6e7d2c68adfbf3ab639b
 SHA1 (patch-ds) = e0319c5f63ed56ab8a9ddc96759f16fd43395096
 SHA1 (patch-dt) = 0cbf8245fbb5475dc864acc4e7c1490095377a6e
+SHA1 (patch-ea) = dfd754c3b7aaa1c86ca1b040e7e87b6f7898f5e1
 SHA1 (patch-mib2cupdate) = d6773633c8737fe45a58e378967995e21012d21d
diff -r 0e05c5856f7a -r eccbebbf5650 net/net-snmp/patches/patch-ea
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/net/net-snmp/patches/patch-ea     Fri Sep 15 20:13:53 2006 +0000
@@ -0,0 +1,454 @@
+$NetBSD: patch-ea,v 1.1 2006/09/15 20:13:55 christos Exp $
+
+--- snmplib/snmp_api.c.orig    2006-03-09 17:01:14.000000000 -0500
++++ snmplib/snmp_api.c 2006-09-15 11:59:02.723578061 -0400
+@@ -6781,7 +6781,7 @@
+         }
+ #endif /* DISABLE_MIB_LOADING */
+         atmp = inet_addr(value);
+-        if (atmp != (long) -1 || !strcmp(value, "255.255.255.255"))
++        if (atmp != (in_addr_t) -1 || !strcmp(value, "255.255.255.255"))
+             snmp_pdu_add_variable(pdu, name, name_length, ASN_IPADDRESS,
+                                   (u_char *) & atmp, sizeof(atmp));
+         else
+--- snmplib/md5.c.orig 2004-04-19 18:09:07.000000000 -0400
++++ snmplib/md5.c      2006-09-15 12:00:18.530062610 -0400
+@@ -465,7 +465,7 @@
+         goto update_end;
+ 
+     i = len;
+-    if (((unsigned int) data) % sizeof(long) != 0) {
++    if (((unsigned long) data) % sizeof(int) != 0) {
+         /*
+          * this relies on the ability to use integer math and thus we
+          * must rely on data that aligns on 32-bit-word-boundries 
+--- snmplib/text_utils.c.orig  2006-03-09 15:57:35.000000000 -0500
++++ snmplib/text_utils.c       2006-09-15 12:03:41.664878785 -0400
+@@ -461,7 +461,7 @@
+     /*
+      * get value
+      */
+-    switch((int)lpi->user_context) {
++    switch((int)(long)lpi->user_context) {
+ 
+         case PMLP_TYPE_UNSIGNED:
+             tvi->value.ul = strtoul(ptr, NULL, 0);
+@@ -497,7 +497,7 @@
+ 
+         default:
+             snmp_log(LOG_ERR,"unsupported value type %d\n",
+-                     (int)lpi->user_context);
++                     (int)(long)lpi->user_context);
+             break;
+     }
+     
+--- snmplib/scapi.c.orig       2006-01-30 07:08:15.000000000 -0500
++++ snmplib/scapi.c    2006-09-15 12:05:52.357854147 -0400
+@@ -272,7 +272,7 @@
+ 
+     u_char          buf[SNMP_MAXBUF_SMALL];
+ #if  defined(USE_OPENSSL) || defined(USE_PKCS)
+-    size_t             buf_len = sizeof(buf);
++    unsigned int    buf_len = sizeof(buf);
+ #endif
+ 
+     DEBUGTRACE;
+--- snmplib/container_binary_array.c.orig      2005-12-11 14:13:15.000000000 -0500
++++ snmplib/container_binary_array.c   2006-09-15 12:06:45.271966359 -0400
+@@ -405,7 +405,7 @@
+     /*
+      * Insert the new entry into the data array
+      */
+-    t->data[t->count++] = entry;
++    t->data[t->count++] = (void *)(unsigned long)entry;
+     t->dirty = 1;
+     return 0;
+ }
+--- include/net-snmp/types.h.orig      2006-05-26 12:36:06.000000000 -0400
++++ include/net-snmp/types.h   2006-09-15 12:14:05.096058400 -0400
+@@ -162,7 +162,7 @@
+  */
+ 
+     typedef struct netsnmp_index_s {
+-       int          len;
++       size_t       len;
+        oid         *oids;
+     } netsnmp_index;
+ 
+--- snmplib/snmp_logging.c.orig        2006-01-25 11:27:41.000000000 -0500
++++ snmplib/snmp_logging.c     2006-09-15 13:26:28.786672010 -0400
+@@ -380,7 +380,7 @@
+             if (facility == -1)  return -1;
+             logh->pri_max = pri_max;
+             logh->token   = strdup(snmp_log_syslogname(0));
+-            logh->magic   = (void *)facility;
++            logh->magic   = (void *)(long)facility;
+           snmp_enable_syslog_ident(snmp_log_syslogname(0), facility);
+       }
+         break;
+@@ -600,7 +600,7 @@
+             continue;
+         if (logh->type == NETSNMP_LOGHANDLER_SYSLOG) {
+             snmp_disable_syslog_entry(logh);
+-            snmp_enable_syslog_ident(logh->token,(int)logh->magic);
++            snmp_enable_syslog_ident(logh->token,(int)(long)logh->magic);
+         }
+         else if (logh->type == NETSNMP_LOGHANDLER_FILE) {
+             snmp_disable_filelog_entry(logh);
+@@ -1016,7 +1016,7 @@
+        */
+     if (!(logh->imagic)) {
+         const char *ident    = logh->token;
+-        int   facility = (int)logh->magic;
++        int   facility = (int)(long)logh->magic;
+         if (!ident)
+             ident = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
+                                           NETSNMP_DS_LIB_APPTYPE);
+--- agent/helpers/row_merge.c.orig     2006-01-25 11:26:38.000000000 -0500
++++ agent/helpers/row_merge.c  2006-09-15 13:29:02.792124486 -0400
+@@ -31,7 +31,7 @@
+     ret = netsnmp_create_handler("row_merge",
+                                   netsnmp_row_merge_helper_handler);
+     if (ret) {
+-        ret->myvoid = (void *) prefix_len;
++        ret->myvoid = (void *)(long)prefix_len;
+     }
+     return ret;
+ }
+@@ -165,7 +165,7 @@
+      * Use the prefix length as supplied during registration, rather
+      *  than trying to second-guess what the MIB implementer wanted.
+      */
+-    int SKIP_OID = (int)handler->myvoid;
++    int SKIP_OID = (int)(long)handler->myvoid;
+ 
+     DEBUGMSGTL(("helper:row_merge", "Got request (%d): ", SKIP_OID));
+     DEBUGMSGOID(("helper:row_merge", reginfo->rootoid, reginfo->rootoid_len));
+--- agent/mibgroup/ucd-snmp/pass.c.orig        2006-09-15 13:32:02.702526885 -0400
++++ agent/mibgroup/ucd-snmp/pass.c     2006-09-15 13:31:29.416161961 -0400
+@@ -163,6 +163,7 @@
+ {
+     struct extensible **ppass = &passthrus, **etmp, *ptmp;
+     char           *tcptr, *endopt;
++    long          priorl;
+     int             i, priority;
+ 
+     /*
+@@ -180,10 +181,12 @@
+         config_perror("priority must be an integer");
+         return;
+       }
+-      priority = strtol((const char*) cptr, &endopt, 0);
+-      if ((priority == LONG_MIN) || (priority == LONG_MAX)) {
++      priorl = strtol((const char*) cptr, &endopt, 0);
++      if ((priorl <= INT_MIN) || (priorl >= INT_MAX)) {
+         config_perror("priority under/overflow");
+         return;
++      } else {
++        priority = (int)priorl;
+       }
+       cptr = endopt;
+       cptr = skip_white(cptr);
+--- agent/mibgroup/ucd-snmp/pass_persist.c.orig        2005-10-03 07:52:44.000000000 -0400
++++ agent/mibgroup/ucd-snmp/pass_persist.c     2006-09-15 13:33:19.013118652 -0400
+@@ -89,6 +89,7 @@
+ {
+     struct extensible **ppass = &persistpassthrus, **etmp, *ptmp;
+     char           *tcptr, *endopt;
++    long          priorl;
+     int             i, priority;
+ 
+     /*
+@@ -106,10 +107,12 @@
+         config_perror("priority must be an integer");
+         return;
+       }
+-      priority = strtol((const char*) cptr, &endopt, 0);
+-      if ((priority == LONG_MIN) || (priority == LONG_MAX)) {
++      priorl = strtol((const char*) cptr, &endopt, 0);
++      if ((priorl <= INT_MIN) || (priorl >= INT_MAX)) {
+         config_perror("priority under/overflow");
+         return;
++      } else {
++        priority = (int)priorl;
+       }
+       cptr = endopt;
+       cptr = skip_white(cptr);
+--- ./agent/mibgroup/agent/nsDebug.c.orig      2005-04-21 09:32:20.000000000 -0400
++++ ./agent/mibgroup/agent/nsDebug.c   2006-09-15 13:34:51.994897981 -0400
+@@ -291,7 +291,7 @@
+ 
+     snmp_set_var_value(index, dbg_tokens[i].token_name,
+                      strlen(dbg_tokens[i].token_name));
+-    *loop_context = (void*)i;
++    *loop_context = (void*)(long)i;
+     *data_context = (void*)&dbg_tokens[i];
+     return index;
+ }
+@@ -301,7 +301,7 @@
+                       netsnmp_variable_list *index,
+                       netsnmp_iterator_info *data)
+ {
+-    int i = (int)*loop_context;
++    int i = (int)(long)*loop_context;
+ 
+     for (i++; i<debug_num_tokens; i++) {
+         /* skip excluded til mib is updated */
+@@ -313,7 +313,7 @@
+ 
+     snmp_set_var_value(index, dbg_tokens[i].token_name,
+                      strlen(dbg_tokens[i].token_name));
+-    *loop_context = (void*)i;
++    *loop_context = (void*)(long)i;
+     *data_context = (void*)&dbg_tokens[i];
+     return index;
+ }
+--- ./agent/mibgroup/host/hr_device.c.orig     2005-11-17 20:44:47.000000000 -0500
++++ ./agent/mibgroup/host/hr_device.c  2006-09-15 13:35:43.824808435 -0400
+@@ -222,7 +222,7 @@
+ {
+     int             dev_idx, type;
+     oid            *oid_p;
+-    char           *tmp_str;
++    const char           *tmp_str;
+     static char     string[1024];
+ 
+     dev_idx =
+--- ./agent/mibgroup/util_funcs.c.orig 2005-12-05 07:15:27.000000000 -0500
++++ ./agent/mibgroup/util_funcs.c      2006-09-15 13:37:10.161316785 -0400
+@@ -237,7 +237,7 @@
+ #if HAVE_EXECV
+     char            cachefile[STRMAX];
+     char            cache[MAXCACHESIZE];
+-    ssize_t         cachebytes;
++    int             cachebytes;
+     int             cfd;
+ #ifdef EXCACHETIME
+     long            curtime;
+--- ./agent/mibgroup/if-mib/ifTable/ifTable_interface.c.orig   2006-02-10 17:58:26.000000000 -0500
++++ ./agent/mibgroup/if-mib/ifTable/ifTable_interface.c        2006-09-15 13:40:07.507226461 -0400
+@@ -1409,7 +1409,7 @@
+         netsnmp_assert(NULL != dl);
+         ++(*(int*)&dl->data);
+         DEBUGMSGTL(("internal:ifTable:_mfd_ifTable_undo_setup_allocate",
+-                    "++refcount = %d\n",(int)dl->data));
++                    "++refcount = %d\n",(int)(long)dl->data));
+     }
+ 
+     return rc;
+@@ -1487,9 +1487,9 @@
+         return; /* better to lead than double free */
+ 
+     --(*(int*)&dl->data);
+-    snmp_log(LOG_ERR, "--refcount at %d\n", (int)dl->data);
++    snmp_log(LOG_ERR, "--refcount at %d\n", (int)(long)dl->data);
+ 
+-    if (0 == (int)dl->data) {
++    if (0 == (int)(long)dl->data) {
+         netsnmp_access_interface_entry_free(rowreq_ctx->undo->ifentry);
+         ifTable_release_data(rowreq_ctx->undo);
+         rowreq_ctx->undo = NULL;
+--- agent/agent_registry.c.orig        2006-06-13 08:50:36.000000000 -0400
++++ agent/agent_registry.c     2006-09-15 13:45:00.415231055 -0400
+@@ -1458,7 +1458,7 @@
+     lookup_cache *lookup_cache = NULL;
+     netsnmp_subtree *myptr = NULL, *previous = NULL;
+     int cmp = 1;
+-    int ll_off = 0;
++    size_t ll_off = 0;
+ 
+     if (subtree) {
+         myptr = subtree;
+--- ./agent/mibgroup/utilities/iquery.c.orig   2006-04-11 07:10:16.000000000 -0400
++++ ./agent/mibgroup/utilities/iquery.c        2006-09-15 13:46:09.604459976 -0400
+@@ -153,7 +153,7 @@
+         memdup( &(ss->securityEngineID), engineID, engIDLen );
+         ss->securityEngineIDLen = engIDLen;
+         if ( version == SNMP_VERSION_3 ) {
+-            memdup(&(ss->securityName), secName, strlen(secName));
++            memdup((u_char **)&(ss->securityName), secName, strlen(secName));
+             ss->securityNameLen = strlen(secName);
+         } else {
+             memdup( &(ss->community), secName, strlen(secName));
+--- perl/OID/OID.xs.orig       2005-09-09 06:09:31.000000000 -0400
++++ perl/OID/OID.xs    2006-09-15 13:51:01.268231665 -0400
+@@ -177,17 +177,21 @@
+ netsnmp_oid *
+ nso_newptr(initstring)
+     char *initstring
++    PREINIT:
++      STRLEN          len;
+     CODE:



Home | Main Index | Thread Index | Old Index