summaryrefslogtreecommitdiff
path: root/net/net-snmp
diff options
context:
space:
mode:
authorseb <seb@pkgsrc.org>2006-10-01 20:08:29 +0000
committerseb <seb@pkgsrc.org>2006-10-01 20:08:29 +0000
commit0e100bca2b788115065985c0c93aaebc61ea0e6e (patch)
tree383266656edfcbf069881ffb1be0a05e99789cc9 /net/net-snmp
parentbdba6495e77dd1744dc8cd81c2ec83383097bf5f (diff)
downloadpkgsrc-0e100bca2b788115065985c0c93aaebc61ea0e6e.tar.gz
Split LP64 related patch file (patch-ea) from christos@ so that there is
one patched file per patch file.
Diffstat (limited to 'net/net-snmp')
-rw-r--r--net/net-snmp/distinfo21
-rw-r--r--net/net-snmp/patches/patch-ea449
-rw-r--r--net/net-snmp/patches/patch-eb13
-rw-r--r--net/net-snmp/patches/patch-ec22
-rw-r--r--net/net-snmp/patches/patch-ed31
-rw-r--r--net/net-snmp/patches/patch-ee13
-rw-r--r--net/net-snmp/patches/patch-ef25
-rw-r--r--net/net-snmp/patches/patch-eg27
-rw-r--r--net/net-snmp/patches/patch-eh27
-rw-r--r--net/net-snmp/patches/patch-ei13
-rw-r--r--net/net-snmp/patches/patch-ej13
-rw-r--r--net/net-snmp/patches/patch-ek13
-rw-r--r--net/net-snmp/patches/patch-el29
-rw-r--r--net/net-snmp/patches/patch-em157
-rw-r--r--net/net-snmp/patches/patch-en13
-rw-r--r--net/net-snmp/patches/patch-eo13
-rw-r--r--net/net-snmp/patches/patch-ep13
-rw-r--r--net/net-snmp/patches/patch-eq31
-rw-r--r--net/net-snmp/patches/patch-er22
19 files changed, 498 insertions, 447 deletions
diff --git a/net/net-snmp/distinfo b/net/net-snmp/distinfo
index fb685546e3c..2c7a9cb5c08 100644
--- a/net/net-snmp/distinfo
+++ b/net/net-snmp/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.30 2006/09/24 15:04:35 joerg Exp $
+$NetBSD: distinfo,v 1.31 2006/10/01 20:08:29 seb Exp $
SHA1 (net-snmp-5.3.1.tar.gz) = 8ddb5122769814f04a7d3d352dcc640df7c89d41
RMD160 (net-snmp-5.3.1.tar.gz) = 7bcdd213fb2517d0927b030deab5146522b58b3d
@@ -32,5 +32,22 @@ SHA1 (patch-dq) = 619d94d9937098b684ee8d0f1a3a92dfdff2155c
SHA1 (patch-dr) = ab75e5cf3448d9c0520b6e7d2c68adfbf3ab639b
SHA1 (patch-ds) = e0319c5f63ed56ab8a9ddc96759f16fd43395096
SHA1 (patch-dt) = a123c867d5c69bcc64b82a793036527c20a6397b
-SHA1 (patch-ea) = dfd754c3b7aaa1c86ca1b040e7e87b6f7898f5e1
+SHA1 (patch-ea) = a53857229ff07b943c488b816d051ef7f369b5e2
+SHA1 (patch-eb) = 2685186d7b77481f8668fe63e83ce22a17679678
+SHA1 (patch-ec) = 35b431de21cebe3e11cefe363218e8ac8e202213
+SHA1 (patch-ed) = 078820662a1dccda93ca7b34572f6de968343717
+SHA1 (patch-ee) = 988ba7717a4e72cf12b7f27035062db66bc501ab
+SHA1 (patch-ef) = 9a1064c35e5d1982a12a2b71c37a7bf3ac15c81f
+SHA1 (patch-eg) = 421ccf1c810a2b03d7ff10fe38e8a3eea62d9836
+SHA1 (patch-eh) = c2dbd651a0fcf6e20b8a9eee68f0ab30763af912
+SHA1 (patch-ei) = b32105823cca960d4ee224ca175fff6c00065df6
+SHA1 (patch-ej) = c8047a6109bf6b833c56562d48b56b480c4299be
+SHA1 (patch-ek) = f8a9509b4e7c8fc8c64765525b852c75d5fad41f
+SHA1 (patch-el) = e9cde69d2c60047ad96e1ffe78fabad5bbcf355b
+SHA1 (patch-em) = 5130a0f993ac10b6a2269c79ff786efe09ee67a7
+SHA1 (patch-en) = 07fbbcf0477a71e1f71cb9d4292f8178323ab548
+SHA1 (patch-eo) = c1d0acc750c024428bea046fae001c8184242105
+SHA1 (patch-ep) = 952e24044ad8a5fe370166d61c76c4760196365c
+SHA1 (patch-eq) = 52f831c88fd7d1f2153686bb5288f4f093a0f41f
+SHA1 (patch-er) = 1ca5658a6c97210174c83f63cc5791d02037541b
SHA1 (patch-mib2cupdate) = d6773633c8737fe45a58e378967995e21012d21d
diff --git a/net/net-snmp/patches/patch-ea b/net/net-snmp/patches/patch-ea
index a4338fbc75b..c5b3de1274c 100644
--- a/net/net-snmp/patches/patch-ea
+++ b/net/net-snmp/patches/patch-ea
@@ -1,8 +1,8 @@
-$NetBSD: patch-ea,v 1.1 2006/09/15 20:13:55 christos Exp $
+$NetBSD: patch-ea,v 1.2 2006/10/01 20:08:29 seb 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 @@
+--- snmplib/snmp_api.c.orig 2006-03-09 22:01:14.000000000 +0000
++++ snmplib/snmp_api.c
+@@ -6781,7 +6781,7 @@ snmp_add_var(netsnmp_pdu *pdu,
}
#endif /* DISABLE_MIB_LOADING */
atmp = inet_addr(value);
@@ -11,444 +11,3 @@ $NetBSD: patch-ea,v 1.1 2006/09/15 20:13:55 christos Exp $
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:
- if (get_tree_head() == NULL)
- init_mib();
- RETVAL = SNMP_MALLOC_TYPEDEF(netsnmp_oid);
- RETVAL->name = RETVAL->namebuf;
-- RETVAL->len = sizeof(RETVAL->namebuf)/sizeof(RETVAL->namebuf[0]);
-- if (!snmp_parse_oid(initstring, (oid *) RETVAL->name, &RETVAL->len)) {
-+ len = sizeof(RETVAL->namebuf)/sizeof(RETVAL->namebuf[0]);
-+ if (!snmp_parse_oid(initstring, (oid *) RETVAL->name, &len)) {
- snmp_log(LOG_ERR, "Can't parse: %s\n", initstring);
- RETVAL->len = 0;
- RETVAL = NULL;
-- }
-+ } else {
-+ RETVAL->len = len;
-+ }
- OUTPUT:
- RETVAL
-
---- ./perl/SNMP/SNMP.xs.orig 2006-05-26 12:59:15.000000000 -0400
-+++ ./perl/SNMP/SNMP.xs 2006-09-15 14:11:11.883749613 -0400
-@@ -117,15 +117,15 @@
- netsnmp_variable_list*, struct tree *,
- int, int));
- static int __sprint_num_objid _((char *, oid *, int));
--static int __scan_num_objid _((char *, oid *, int *));
-+static int __scan_num_objid _((char *, oid *, size_t *));
- static int __get_type_str _((int, char *));
- static int __get_label_iid _((char *, char **, char **, int));
- static int __oid_cmp _((oid *, int, oid *, int));
- static int __tp_sprint_num_objid _((char*,SnmpMibNode *));
- static SnmpMibNode * __get_next_mib_node _((SnmpMibNode *));
- static struct tree * __oid2tp _((oid*, int, struct tree *, int*));
--static struct tree * __tag2oid _((char *, char *, oid *, int *, int *, int));
--static int __concat_oid_str _((oid *, int *, char *));
-+static struct tree * __tag2oid _((char *, char *, oid *, size_t *, int *, int));
-+static int __concat_oid_str _((oid *, size_t *, char *));
- static int __add_var_val_str _((netsnmp_pdu *, oid *, int, char *,
- int, int));
- static int __send_sync_pdu _((netsnmp_session *, netsnmp_pdu *,
-@@ -583,7 +583,7 @@
- __scan_num_objid (buf, objid, len)
- char *buf;
- oid *objid;
--int *len;
-+size_t *len;
- {
- char *cp;
- *len = 0;
-@@ -874,14 +874,14 @@
- char * tag;
- char * iid;
- oid * oid_arr;
--int * oid_arr_len;
-+size_t * oid_arr_len;
- int * type;
- int best_guess;
- {
- struct tree *tp = NULL;
- struct tree *rtp = NULL;
- oid newname[MAX_OID_LEN], *op;
-- int newname_len = 0;
-+ size_t newname_len = 0;
- const char *cp = NULL;
- char *module = NULL;
-
-@@ -1022,7 +1022,7 @@
- static int
- __concat_oid_str(doid_arr, doid_arr_len, soid_str)
- oid *doid_arr;
--int *doid_arr_len;
-+size_t *doid_arr_len;
- char * soid_str;
- {
- char soid_buf[STR_BUF_SIZE];
-@@ -1911,7 +1911,7 @@
- ** we sent in this request. Note that this is not a valid SNMP PDU,
- ** but that's because a response has not yet been received.
- */
-- return (netsnmp_pdu *)reqid;
-+ return (netsnmp_pdu *)(long)reqid;
- }
-
- /* This code is for synchronous mode support.
-@@ -3006,7 +3006,7 @@
- netsnmp_pdu *pdu, *response;
- struct tree *tp;
- oid *oid_arr;
-- int oid_arr_len = MAX_OID_LEN;
-+ size_t oid_arr_len = MAX_OID_LEN;
- char *tag_pv;
- snmp_xs_cb_data *xs_cb_data;
- SV **sess_ptr_sv;
-@@ -3207,7 +3207,7 @@
- struct tree *tp;
- int len;
- oid *oid_arr;
-- int oid_arr_len = MAX_OID_LEN;
-+ size_t oid_arr_len = MAX_OID_LEN;
- SV *tmp_sv;
- int type;
- char tmp_type_str[MAX_TYPE_NAME_LEN];
-@@ -3425,7 +3425,7 @@
- struct tree *tp;
- int len;
- oid *oid_arr;
-- int oid_arr_len = MAX_OID_LEN;
-+ size_t oid_arr_len = MAX_OID_LEN;
- SV *tmp_sv;
- int type;
- char tmp_type_str[MAX_TYPE_NAME_LEN];
-@@ -3669,7 +3669,7 @@
- struct tree *tp;
- int len;
- oid *oid_arr;
-- int oid_arr_len = MAX_OID_LEN;
-+ size_t oid_arr_len = MAX_OID_LEN;
- SV *tmp_sv;
- int type;
- char tmp_type_str[MAX_TYPE_NAME_LEN];
-@@ -3897,7 +3897,7 @@
- netsnmp_session *ss;
- netsnmp_pdu *pdu = NULL;
- oid oid_arr[MAX_OID_LEN];
-- int oid_arr_len;
-+ size_t oid_arr_len;
- SV **sess_ptr_sv;
- SV **err_str_svp;
- SV **err_num_svp;
-@@ -4115,7 +4115,7 @@
- /* Sent okay... Return the request ID in 'pdu' as an SvIV. */
- DBPRT(1,(DBOUT "Okay, request id is %d\n", (intptr_t) pdu));
- /* XSRETURN_IV((intptr_t)pdu); */
-- XPUSHs(sv_2mortal(newSViv(pdu)));
-+ XPUSHs(sv_2mortal(newSViv((intptr_t)pdu)));
- XSRETURN(1);
- }
-
-@@ -4208,7 +4208,7 @@
- netsnmp_pdu *pdu = NULL;
- struct tree *tp;
- oid *oid_arr;
-- int oid_arr_len = MAX_OID_LEN;
-+ size_t oid_arr_len = MAX_OID_LEN;
- SV **sess_ptr_sv;
- SV **err_str_svp;
- SV **err_num_svp;
-@@ -4347,7 +4347,7 @@
- netsnmp_pdu *pdu = NULL;
- struct tree *tp;
- oid *oid_arr;
-- int oid_arr_len = MAX_OID_LEN;
-+ size_t oid_arr_len = MAX_OID_LEN;
- SV **sess_ptr_sv;
- SV **err_str_svp;
- SV **err_num_svp;
-@@ -4484,7 +4484,7 @@
- netsnmp_pdu *response;
- struct tree *tp;
- oid *oid_arr;
-- int oid_arr_len = MAX_OID_LEN;
-+ size_t oid_arr_len = MAX_OID_LEN;
- snmp_xs_cb_data *xs_cb_data;
- SV **sess_ptr_sv;
- SV **err_str_svp;
-@@ -4715,7 +4715,7 @@
- char str_buf[STR_BUF_SIZE];
- char str_buf_temp[STR_BUF_SIZE];
- oid oid_arr[MAX_OID_LEN];
-- int oid_arr_len = MAX_OID_LEN;
-+ size_t oid_arr_len = MAX_OID_LEN;
- char * label;
- char * iid;
- int status = FAILURE;
diff --git a/net/net-snmp/patches/patch-eb b/net/net-snmp/patches/patch-eb
new file mode 100644
index 00000000000..94cea3b1188
--- /dev/null
+++ b/net/net-snmp/patches/patch-eb
@@ -0,0 +1,13 @@
+$NetBSD: patch-eb,v 1.1 2006/10/01 20:08:29 seb Exp $
+
+--- agent/agent_registry.c.orig 2006-06-13 12:50:36.000000000 +0000
++++ agent/agent_registry.c
+@@ -1458,7 +1458,7 @@ netsnmp_subtree_find_prev(oid *name, siz
+ 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;
diff --git a/net/net-snmp/patches/patch-ec b/net/net-snmp/patches/patch-ec
new file mode 100644
index 00000000000..81247c497f7
--- /dev/null
+++ b/net/net-snmp/patches/patch-ec
@@ -0,0 +1,22 @@
+$NetBSD: patch-ec,v 1.1 2006/10/01 20:08:29 seb Exp $
+
+--- agent/helpers/row_merge.c.orig 2006-01-25 16:26:38.000000000 +0000
++++ agent/helpers/row_merge.c
+@@ -31,7 +31,7 @@ netsnmp_get_row_merge_handler(int prefix
+ 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 @@ netsnmp_row_merge_helper_handler(netsnmp
+ * 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));
diff --git a/net/net-snmp/patches/patch-ed b/net/net-snmp/patches/patch-ed
new file mode 100644
index 00000000000..6a9e5c4cfdc
--- /dev/null
+++ b/net/net-snmp/patches/patch-ed
@@ -0,0 +1,31 @@
+$NetBSD: patch-ed,v 1.1 2006/10/01 20:08:29 seb Exp $
+
+--- agent/mibgroup/agent/nsDebug.c.orig 2005-04-21 13:32:20.000000000 +0000
++++ agent/mibgroup/agent/nsDebug.c
+@@ -291,7 +291,7 @@ get_first_debug_entry(void **loop_contex
+
+ 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 @@ get_next_debug_entry(void **loop_context
+ 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 @@ get_next_debug_entry(void **loop_context
+
+ 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;
+ }
diff --git a/net/net-snmp/patches/patch-ee b/net/net-snmp/patches/patch-ee
new file mode 100644
index 00000000000..81d2e626ff6
--- /dev/null
+++ b/net/net-snmp/patches/patch-ee
@@ -0,0 +1,13 @@
+$NetBSD: patch-ee,v 1.1 2006/10/01 20:08:29 seb Exp $
+
+--- agent/mibgroup/host/hr_device.c.orig 2005-11-18 01:44:47.000000000 +0000
++++ agent/mibgroup/host/hr_device.c
+@@ -222,7 +222,7 @@ var_hrdevice(struct variable *vp,
+ {
+ int dev_idx, type;
+ oid *oid_p;
+- char *tmp_str;
++ const char *tmp_str;
+ static char string[1024];
+
+ dev_idx =
diff --git a/net/net-snmp/patches/patch-ef b/net/net-snmp/patches/patch-ef
new file mode 100644
index 00000000000..5339209f626
--- /dev/null
+++ b/net/net-snmp/patches/patch-ef
@@ -0,0 +1,25 @@
+$NetBSD: patch-ef,v 1.1 2006/10/01 20:08:29 seb Exp $
+
+--- agent/mibgroup/if-mib/ifTable/ifTable_interface.c.orig 2006-02-10 22:58:26.000000000 +0000
++++ agent/mibgroup/if-mib/ifTable/ifTable_interface.c
+@@ -1409,7 +1409,7 @@ _mfd_ifTable_undo_setup_allocate(ifTable
+ 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 @@ _mfd_ifTable_undo_setup_release(ifTable_
+ 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;
diff --git a/net/net-snmp/patches/patch-eg b/net/net-snmp/patches/patch-eg
new file mode 100644
index 00000000000..aead42a5c70
--- /dev/null
+++ b/net/net-snmp/patches/patch-eg
@@ -0,0 +1,27 @@
+$NetBSD: patch-eg,v 1.1 2006/10/01 20:08:29 seb Exp $
+
+--- agent/mibgroup/ucd-snmp/pass.c.orig 2005-08-18 00:44:02.000000000 +0000
++++ agent/mibgroup/ucd-snmp/pass.c
+@@ -163,6 +163,7 @@ pass_parse_config(const char *token, cha
+ {
+ struct extensible **ppass = &passthrus, **etmp, *ptmp;
+ char *tcptr, *endopt;
++ long priorl;
+ int i, priority;
+
+ /*
+@@ -180,10 +181,12 @@ pass_parse_config(const char *token, cha
+ 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);
diff --git a/net/net-snmp/patches/patch-eh b/net/net-snmp/patches/patch-eh
new file mode 100644
index 00000000000..ac2e56e9879
--- /dev/null
+++ b/net/net-snmp/patches/patch-eh
@@ -0,0 +1,27 @@
+$NetBSD: patch-eh,v 1.1 2006/10/01 20:08:29 seb Exp $
+
+--- agent/mibgroup/ucd-snmp/pass_persist.c.orig 2005-10-03 11:52:44.000000000 +0000
++++ agent/mibgroup/ucd-snmp/pass_persist.c
+@@ -89,6 +89,7 @@ pass_persist_parse_config(const char *to
+ {
+ struct extensible **ppass = &persistpassthrus, **etmp, *ptmp;
+ char *tcptr, *endopt;
++ long priorl;
+ int i, priority;
+
+ /*
+@@ -106,10 +107,12 @@ pass_persist_parse_config(const char *to
+ 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);
diff --git a/net/net-snmp/patches/patch-ei b/net/net-snmp/patches/patch-ei
new file mode 100644
index 00000000000..84a00aaae52
--- /dev/null
+++ b/net/net-snmp/patches/patch-ei
@@ -0,0 +1,13 @@
+$NetBSD: patch-ei,v 1.1 2006/10/01 20:08:29 seb Exp $
+
+--- agent/mibgroup/util_funcs.c.orig 2005-12-05 12:15:27.000000000 +0000
++++ agent/mibgroup/util_funcs.c
+@@ -237,7 +237,7 @@ get_exec_output(struct extensible *ex)
+ #if HAVE_EXECV
+ char cachefile[STRMAX];
+ char cache[MAXCACHESIZE];
+- ssize_t cachebytes;
++ int cachebytes;
+ int cfd;
+ #ifdef EXCACHETIME
+ long curtime;
diff --git a/net/net-snmp/patches/patch-ej b/net/net-snmp/patches/patch-ej
new file mode 100644
index 00000000000..540287da409
--- /dev/null
+++ b/net/net-snmp/patches/patch-ej
@@ -0,0 +1,13 @@
+$NetBSD: patch-ej,v 1.1 2006/10/01 20:08:29 seb Exp $
+
+--- agent/mibgroup/utilities/iquery.c.orig 2006-04-11 11:10:16.000000000 +0000
++++ agent/mibgroup/utilities/iquery.c
+@@ -153,7 +153,7 @@ netsnmp_session *netsnmp_iquery_session(
+ 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));
diff --git a/net/net-snmp/patches/patch-ek b/net/net-snmp/patches/patch-ek
new file mode 100644
index 00000000000..01c996b56bc
--- /dev/null
+++ b/net/net-snmp/patches/patch-ek
@@ -0,0 +1,13 @@
+$NetBSD: patch-ek,v 1.1 2006/10/01 20:08:29 seb Exp $
+
+--- include/net-snmp/types.h.orig 2006-05-26 16:36:06.000000000 +0000
++++ include/net-snmp/types.h
+@@ -162,7 +162,7 @@ typedef unsigned INT64_T uint64_t;
+ */
+
+ typedef struct netsnmp_index_s {
+- int len;
++ size_t len;
+ oid *oids;
+ } netsnmp_index;
+
diff --git a/net/net-snmp/patches/patch-el b/net/net-snmp/patches/patch-el
new file mode 100644
index 00000000000..91269c47b6a
--- /dev/null
+++ b/net/net-snmp/patches/patch-el
@@ -0,0 +1,29 @@
+$NetBSD: patch-el,v 1.1 2006/10/01 20:08:29 seb Exp $
+
+--- perl/OID/OID.xs.orig 2005-09-09 10:09:31.000000000 +0000
++++ perl/OID/OID.xs
+@@ -177,17 +177,21 @@ MODULE = NetSNMP::OID PACKAGE = NetSNMP
+ netsnmp_oid *
+ nso_newptr(initstring)
+ char *initstring
++ PREINIT:
++ STRLEN len;
+ CODE:
+ if (get_tree_head() == NULL)
+ init_mib();
+ RETVAL = SNMP_MALLOC_TYPEDEF(netsnmp_oid);
+ RETVAL->name = RETVAL->namebuf;
+- RETVAL->len = sizeof(RETVAL->namebuf)/sizeof(RETVAL->namebuf[0]);
+- if (!snmp_parse_oid(initstring, (oid *) RETVAL->name, &RETVAL->len)) {
++ len = sizeof(RETVAL->namebuf)/sizeof(RETVAL->namebuf[0]);
++ if (!snmp_parse_oid(initstring, (oid *) RETVAL->name, &len)) {
+ snmp_log(LOG_ERR, "Can't parse: %s\n", initstring);
+ RETVAL->len = 0;
+ RETVAL = NULL;
+- }
++ } else {
++ RETVAL->len = len;
++ }
+ OUTPUT:
+ RETVAL
+
diff --git a/net/net-snmp/patches/patch-em b/net/net-snmp/patches/patch-em
new file mode 100644
index 00000000000..48d24d95f0d
--- /dev/null
+++ b/net/net-snmp/patches/patch-em
@@ -0,0 +1,157 @@
+$NetBSD: patch-em,v 1.1 2006/10/01 20:08:29 seb Exp $
+
+--- perl/SNMP/SNMP.xs.orig 2006-05-26 16:59:15.000000000 +0000
++++ perl/SNMP/SNMP.xs
+@@ -117,15 +117,15 @@ static int __snprint_value _((char *, si
+ netsnmp_variable_list*, struct tree *,
+ int, int));
+ static int __sprint_num_objid _((char *, oid *, int));
+-static int __scan_num_objid _((char *, oid *, int *));
++static int __scan_num_objid _((char *, oid *, size_t *));
+ static int __get_type_str _((int, char *));
+ static int __get_label_iid _((char *, char **, char **, int));
+ static int __oid_cmp _((oid *, int, oid *, int));
+ static int __tp_sprint_num_objid _((char*,SnmpMibNode *));
+ static SnmpMibNode * __get_next_mib_node _((SnmpMibNode *));
+ static struct tree * __oid2tp _((oid*, int, struct tree *, int*));
+-static struct tree * __tag2oid _((char *, char *, oid *, int *, int *, int));
+-static int __concat_oid_str _((oid *, int *, char *));
++static struct tree * __tag2oid _((char *, char *, oid *, size_t *, int *, int));
++static int __concat_oid_str _((oid *, size_t *, char *));
+ static int __add_var_val_str _((netsnmp_pdu *, oid *, int, char *,
+ int, int));
+ static int __send_sync_pdu _((netsnmp_session *, netsnmp_pdu *,
+@@ -583,7 +583,7 @@ static int
+ __scan_num_objid (buf, objid, len)
+ char *buf;
+ oid *objid;
+-int *len;
++size_t *len;
+ {
+ char *cp;
+ *len = 0;
+@@ -874,14 +874,14 @@ __tag2oid(tag, iid, oid_arr, oid_arr_len
+ char * tag;
+ char * iid;
+ oid * oid_arr;
+-int * oid_arr_len;
++size_t * oid_arr_len;
+ int * type;
+ int best_guess;
+ {
+ struct tree *tp = NULL;
+ struct tree *rtp = NULL;
+ oid newname[MAX_OID_LEN], *op;
+- int newname_len = 0;
++ size_t newname_len = 0;
+ const char *cp = NULL;
+ char *module = NULL;
+
+@@ -1022,7 +1022,7 @@ found:
+ static int
+ __concat_oid_str(doid_arr, doid_arr_len, soid_str)
+ oid *doid_arr;
+-int *doid_arr_len;
++size_t *doid_arr_len;
+ char * soid_str;
+ {
+ char soid_buf[STR_BUF_SIZE];
+@@ -1911,7 +1911,7 @@ _bulkwalk_send_pdu(walk_context *context
+ ** we sent in this request. Note that this is not a valid SNMP PDU,
+ ** but that's because a response has not yet been received.
+ */
+- return (netsnmp_pdu *)reqid;
++ return (netsnmp_pdu *)(long)reqid;
+ }
+
+ /* This code is for synchronous mode support.
+@@ -3006,7 +3006,7 @@ snmp_set(sess_ref, varlist_ref, perl_cal
+ netsnmp_pdu *pdu, *response;
+ struct tree *tp;
+ oid *oid_arr;
+- int oid_arr_len = MAX_OID_LEN;
++ size_t oid_arr_len = MAX_OID_LEN;
+ char *tag_pv;
+ snmp_xs_cb_data *xs_cb_data;
+ SV **sess_ptr_sv;
+@@ -3207,7 +3207,7 @@ snmp_get(sess_ref, retry_nosuch, varlist
+ struct tree *tp;
+ int len;
+ oid *oid_arr;
+- int oid_arr_len = MAX_OID_LEN;
++ size_t oid_arr_len = MAX_OID_LEN;
+ SV *tmp_sv;
+ int type;
+ char tmp_type_str[MAX_TYPE_NAME_LEN];
+@@ -3425,7 +3425,7 @@ snmp_getnext(sess_ref, varlist_ref, perl
+ struct tree *tp;
+ int len;
+ oid *oid_arr;
+- int oid_arr_len = MAX_OID_LEN;
++ size_t oid_arr_len = MAX_OID_LEN;
+ SV *tmp_sv;
+ int type;
+ char tmp_type_str[MAX_TYPE_NAME_LEN];
+@@ -3669,7 +3669,7 @@ snmp_getbulk(sess_ref, nonrepeaters, max
+ struct tree *tp;
+ int len;
+ oid *oid_arr;
+- int oid_arr_len = MAX_OID_LEN;
++ size_t oid_arr_len = MAX_OID_LEN;
+ SV *tmp_sv;
+ int type;
+ char tmp_type_str[MAX_TYPE_NAME_LEN];
+@@ -3897,7 +3897,7 @@ snmp_bulkwalk(sess_ref, nonrepeaters, ma
+ netsnmp_session *ss;
+ netsnmp_pdu *pdu = NULL;
+ oid oid_arr[MAX_OID_LEN];
+- int oid_arr_len;
++ size_t oid_arr_len;
+ SV **sess_ptr_sv;
+ SV **err_str_svp;
+ SV **err_num_svp;
+@@ -4115,7 +4115,7 @@ snmp_bulkwalk(sess_ref, nonrepeaters, ma
+ /* Sent okay... Return the request ID in 'pdu' as an SvIV. */
+ DBPRT(1,(DBOUT "Okay, request id is %d\n", (intptr_t) pdu));
+ /* XSRETURN_IV((intptr_t)pdu); */
+- XPUSHs(sv_2mortal(newSViv(pdu)));
++ XPUSHs(sv_2mortal(newSViv((intptr_t)pdu)));
+ XSRETURN(1);
+ }
+
+@@ -4208,7 +4208,7 @@ snmp_trapV1(sess_ref,enterprise,agent,ge
+ netsnmp_pdu *pdu = NULL;
+ struct tree *tp;
+ oid *oid_arr;
+- int oid_arr_len = MAX_OID_LEN;
++ size_t oid_arr_len = MAX_OID_LEN;
+ SV **sess_ptr_sv;
+ SV **err_str_svp;
+ SV **err_num_svp;
+@@ -4347,7 +4347,7 @@ snmp_trapV2(sess_ref,uptime,trap_oid,var
+ netsnmp_pdu *pdu = NULL;
+ struct tree *tp;
+ oid *oid_arr;
+- int oid_arr_len = MAX_OID_LEN;
++ size_t oid_arr_len = MAX_OID_LEN;
+ SV **sess_ptr_sv;
+ SV **err_str_svp;
+ SV **err_num_svp;
+@@ -4484,7 +4484,7 @@ snmp_inform(sess_ref,uptime,trap_oid,var
+ netsnmp_pdu *response;
+ struct tree *tp;
+ oid *oid_arr;
+- int oid_arr_len = MAX_OID_LEN;
++ size_t oid_arr_len = MAX_OID_LEN;
+ snmp_xs_cb_data *xs_cb_data;
+ SV **sess_ptr_sv;
+ SV **err_str_svp;
+@@ -4715,7 +4715,7 @@ snmp_translate_obj(var,mode,use_long,aut
+ char str_buf[STR_BUF_SIZE];
+ char str_buf_temp[STR_BUF_SIZE];
+ oid oid_arr[MAX_OID_LEN];
+- int oid_arr_len = MAX_OID_LEN;
++ size_t oid_arr_len = MAX_OID_LEN;
+ char * label;
+ char * iid;
+ int status = FAILURE;
diff --git a/net/net-snmp/patches/patch-en b/net/net-snmp/patches/patch-en
new file mode 100644
index 00000000000..1ab6cda7d63
--- /dev/null
+++ b/net/net-snmp/patches/patch-en
@@ -0,0 +1,13 @@
+$NetBSD: patch-en,v 1.1 2006/10/01 20:08:29 seb Exp $
+
+--- snmplib/container_binary_array.c.orig 2005-12-11 19:13:15.000000000 +0000
++++ snmplib/container_binary_array.c
+@@ -405,7 +405,7 @@ netsnmp_binary_array_insert(netsnmp_cont
+ /*
+ * 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;
+ }
diff --git a/net/net-snmp/patches/patch-eo b/net/net-snmp/patches/patch-eo
new file mode 100644
index 00000000000..3cac76c1465
--- /dev/null
+++ b/net/net-snmp/patches/patch-eo
@@ -0,0 +1,13 @@
+$NetBSD: patch-eo,v 1.1 2006/10/01 20:08:29 seb Exp $
+
+--- snmplib/md5.c.orig 2004-04-19 22:09:07.000000000 +0000
++++ snmplib/md5.c
+@@ -465,7 +465,7 @@ MDsign(u_char * data, size_t len, u_char
+ 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
diff --git a/net/net-snmp/patches/patch-ep b/net/net-snmp/patches/patch-ep
new file mode 100644
index 00000000000..ffd75265ade
--- /dev/null
+++ b/net/net-snmp/patches/patch-ep
@@ -0,0 +1,13 @@
+$NetBSD: patch-ep,v 1.1 2006/10/01 20:08:29 seb Exp $
+
+--- snmplib/scapi.c.orig 2006-01-30 12:08:15.000000000 +0000
++++ snmplib/scapi.c
+@@ -272,7 +272,7 @@ sc_generate_keyed_hash(const oid * autht
+
+ 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;
diff --git a/net/net-snmp/patches/patch-eq b/net/net-snmp/patches/patch-eq
new file mode 100644
index 00000000000..e342b7c2ca9
--- /dev/null
+++ b/net/net-snmp/patches/patch-eq
@@ -0,0 +1,31 @@
+$NetBSD: patch-eq,v 1.1 2006/10/01 20:08:29 seb Exp $
+
+--- snmplib/snmp_logging.c.orig 2006-01-25 16:27:41.000000000 +0000
++++ snmplib/snmp_logging.c
+@@ -380,7 +380,7 @@ snmp_log_options(char *optarg, int argc,
+ 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 @@ netsnmp_logging_restart(void)
+ 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 @@ log_handler_syslog( netsnmp_log_handler
+ */
+ 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);
diff --git a/net/net-snmp/patches/patch-er b/net/net-snmp/patches/patch-er
new file mode 100644
index 00000000000..3317fa450b9
--- /dev/null
+++ b/net/net-snmp/patches/patch-er
@@ -0,0 +1,22 @@
+$NetBSD: patch-er,v 1.1 2006/10/01 20:08:29 seb Exp $
+
+--- snmplib/text_utils.c.orig 2006-03-09 20:57:35.000000000 +0000
++++ snmplib/text_utils.c
+@@ -461,7 +461,7 @@ _process_line_tvi(netsnmp_line_info *lin
+ /*
+ * 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 @@ _process_line_tvi(netsnmp_line_info *lin
+
+ default:
+ snmp_log(LOG_ERR,"unsupported value type %d\n",
+- (int)lpi->user_context);
++ (int)(long)lpi->user_context);
+ break;
+ }
+