diff -bru net-snmp-5.1.1/agent/agent_trap.c new/agent/agent_trap.c
--- net-snmp-5.1.1/agent/agent_trap.c	Mon Feb 16 21:46:04 2004
+++ new/agent/agent_trap.c	Sun Jun 13 17:34:41 2004
@@ -956,6 +956,7 @@
 {
     char            tmpbuf[1024];
     char           *sp, *cp, *pp = NULL;
+    int 	    i;
     u_short         sinkport;
 
     if (!snmp_trapcommunity)
@@ -965,11 +966,12 @@
     if (cp)
         pp = strtok(NULL, " \t\n");
     if (cp && pp) {
-        sinkport = atoi(pp);
-        if ((sinkport < 1) || (sinkport > 0xffff)) {
+        i = atoi(pp);
+        if ((i < 1) || (i > 0xffff)) {
             config_perror("trapsink port out of range");
             sinkport = SNMP_TRAP_PORT;
-        }
+        } else
+	    sinkport = (u_short)i;
     } else {
         sinkport = SNMP_TRAP_PORT;
     }
@@ -987,6 +989,7 @@
 {
     char            tmpbuf[1024];
     char           *sp, *cp, *pp = NULL;
+    int 	    i;
     u_short         sinkport;
 
     if (!snmp_trapcommunity)
@@ -996,11 +999,13 @@
     if (cp)
         pp = strtok(NULL, " \t\n");
     if (cp && pp) {
-        sinkport = atoi(pp);
-        if ((sinkport < 1) || (sinkport > 0xffff)) {
+        i = atoi(pp);
+        if ((i < 1) || (i > 0xffff)) {
             config_perror("trapsink port out of range");
             sinkport = SNMP_TRAP_PORT;
-        }
+        } else
+	    sinkport = (u_short)i;
+	
     } else {
         sinkport = SNMP_TRAP_PORT;
     }
@@ -1017,6 +1022,7 @@
 {
     char            tmpbuf[1024];
     char           *sp, *cp, *pp = NULL;
+    int		    i;
     u_short         sinkport;
 
     if (!snmp_trapcommunity)
@@ -1026,11 +1032,12 @@
     if (cp)
         pp = strtok(NULL, " \t\n");
     if (cp && pp) {
-        sinkport = atoi(pp);
-        if ((sinkport < 1) || (sinkport > 0xffff)) {
+        i = atoi(pp);
+        if ((i < 1) || (i > 0xffff)) {
             config_perror("trapsink port out of range");
             sinkport = SNMP_TRAP_PORT;
-        }
+        } else
+	    sinkport = (u_short)i;
     } else {
         sinkport = SNMP_TRAP_PORT;
     }
diff -bru net-snmp-5.1.1/agent/helpers/row_merge.c new/agent/helpers/row_merge.c
--- net-snmp-5.1.1/agent/helpers/row_merge.c	Mon Aug 18 00:02:52 2003
+++ new/agent/helpers/row_merge.c	Sat Jun 12 02:48:24 2004
@@ -28,7 +28,7 @@
  *  handler chain.  
  */
 netsnmp_mib_handler *
-netsnmp_get_row_merge_handler(int prefix_len)
+netsnmp_get_row_merge_handler(long prefix_len)
 {
     netsnmp_mib_handler *ret = NULL;
     ret = netsnmp_create_handler("row_merge",
@@ -74,7 +74,7 @@
      *    being the column subidentifier, so skip this as well.
      */
     /* int SKIP_OID = reginfo->rootoid_len + 2; */
-    int SKIP_OID = (int)handler->myvoid + 1;
+    long SKIP_OID = (long)handler->myvoid + 1;
 
     DEBUGMSGTL(("helper:row_merge", "Got request (%d)\n", SKIP_OID));
     DEBUGMSGOID(("helper:row_merge", reginfo->rootoid, reginfo->rootoid_len));
diff -bru net-snmp-5.1.1/agent/mibgroup/agent/nsDebug.c new/agent/mibgroup/agent/nsDebug.c
--- net-snmp-5.1.1/agent/mibgroup/agent/nsDebug.c	Thu Nov 13 23:47:47 2003
+++ new/agent/mibgroup/agent/nsDebug.c	Sun Jun 13 17:24:12 2004
@@ -279,7 +279,7 @@
                       netsnmp_variable_list *index,
                       netsnmp_iterator_info *data)
 {
-    int i;
+    long i;
 
     for (i=0; i<debug_num_tokens; i++) {
         if (dbg_tokens[i].token_name)
@@ -300,7 +300,7 @@
                       netsnmp_variable_list *index,
                       netsnmp_iterator_info *data)
 {
-    int i = (int)*loop_context;
+    long i = (long)*loop_context;
 
     for (i++; i<debug_num_tokens; i++) {
         if (dbg_tokens[i].token_name)
diff -bru net-snmp-5.1.1/agent/mibgroup/host/hr_print.c new/agent/mibgroup/host/hr_print.c
--- net-snmp-5.1.1/agent/mibgroup/host/hr_print.c	Sun Jun 22 21:42:19 2003
+++ new/agent/mibgroup/host/hr_print.c	Sun Jun 13 20:41:44 2004
@@ -264,8 +264,11 @@
             }
             HRP_name[HRP_names++] = strdup(ptr);
 #if HAVE_CGETNEXT
+#if 0
+    /* XXX Seems on am64 this buf lies on the stack and cannot be deallocated */
             if (buf)
                 free(buf);
+#endif
 #endif
         }
 finish:
diff -bru net-snmp-5.1.1/agent/mibgroup/host/hr_system.c new/agent/mibgroup/host/hr_system.c
--- net-snmp-5.1.1/agent/mibgroup/host/hr_system.c	Mon Jun 14 01:42:38 2004
+++ new/agent/mibgroup/host/hr_system.c	Sun Jun 13 17:25:11 2004
@@ -218,7 +218,7 @@
 #endif
 #if CAN_USE_SYSCTL && defined(CTL_KERN) && defined(KERN_MAXPROC)
     static int      maxproc_mib[] = { CTL_KERN, KERN_MAXPROC };
-    int             buf_size;
+    size_t          buf_size;
 #endif
 #if defined(hpux10) || defined(hpux11)
     struct pst_static pst_buf;
diff -bru net-snmp-5.1.1/agent/mibgroup/mibII/ip.c new/agent/mibgroup/mibII/ip.c
--- net-snmp-5.1.1/agent/mibgroup/mibII/ip.c	Wed Feb  4 12:25:20 2004
+++ new/agent/mibgroup/mibII/ip.c	Sat Jun 12 02:42:34 2004
@@ -406,7 +406,7 @@
          * ipstat.ips_noroute is also incorrect.
          */
         netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
-        return NULL;
+        return (int)NULL;
     case IPREASMTIMEOUT:
         ret_value = IPFRAGTTL;
         type = ASN_INTEGER;
@@ -762,7 +762,8 @@
     int             i;
     static int      sname[4] = { CTL_NET, PF_INET, IPPROTO_IP, 0 };
     size_t          len;
-    int             magic = (int) vmagic;
+/* XXX    int             magic = (int) vmagic; Does not work on 64Bit*/
+    long             magic = (long)(vmagic); 
 
     switch (magic) {
     case IPFORWARDING:
diff -bru net-snmp-5.1.1/agent/mibgroup/mibII/ipv6.c new/agent/mibgroup/mibII/ipv6.c
--- net-snmp-5.1.1/agent/mibgroup/mibII/ipv6.c	Mon Jun 14 01:42:38 2004
+++ new/agent/mibgroup/mibII/ipv6.c	Sun Jun 13 17:22:12 2004
@@ -593,7 +593,7 @@
     int             mib[6] = {
         CTL_NET, PF_LINK, NETLINK_GENERIC, IFMIB_IFDATA, 0, IFDATA_GENERAL
     };
-    int             len;
+    size_t           len;
     struct ifmibdata tmp;
 
     mib[4] = idx;
@@ -631,7 +631,7 @@
         int             name[] = { CTL_NET, PF_INET6, IPPROTO_IPV6, 0 };
         const char     *namestr = NULL;
         int             result;
-        int             resultsiz;
+        size_t          resultsiz;
 
         resultsiz = sizeof(result);
         switch (vp->magic) {
@@ -1241,13 +1241,15 @@
     DEBUGMSGTL(("mibII/ipv6", "start: p=%x\n", p));
 #else
     {
-        const char     *udblist = "net.inet.udp.pcblist";
-        int             len;
+        char           *udblist = "net.inet.udp.pcblist";
+	char	       *p = udblist;
+        size_t          len;
 
         if (sysctlbyname(udblist, 0, &len, 0, 0) < 0)
             return NULL;
         if ((sysctl_buf = malloc(len)) == NULL)
             return NULL;
+	udblist = p;
         if (sysctlbyname(udblist, sysctl_buf, &len, 0, 0) < 0) {
             free(sysctl_buf);
             return NULL;
@@ -1628,13 +1630,15 @@
     p = (caddr_t) tcb6.in6p_next;
 #else
     {
-        const char     *tcblist = "net.inet.tcp.pcblist";
-        int             len;
+        char           *tcblist = "net.inet.tcp.pcblist";
+	char	       *p = tcblist;
+        size_t          len;
 
         if (sysctlbyname(tcblist, 0, &len, 0, 0) < 0)
             return NULL;
         if ((sysctl_buf = malloc(len)) == NULL)
             return NULL;
+	tcblist = p;
         if (sysctlbyname(tcblist, sysctl_buf, &len, 0, 0) < 0) {
             free(sysctl_buf);
             return NULL;
diff -bru net-snmp-5.1.1/agent/mibgroup/mibII/tcpTable.c new/agent/mibgroup/mibII/tcpTable.c
--- net-snmp-5.1.1/agent/mibgroup/mibII/tcpTable.c	Mon Jun 14 01:42:38 2004
+++ new/agent/mibgroup/mibII/tcpTable.c	Mon Jun 14 16:07:40 2004
@@ -728,7 +728,7 @@
         if (nnew->state == 5 /* established */ ||
             nnew->state == 8 /*  closeWait  */ )
             tcp_estab++;
-        memcpy(&(nnew->pcb), &(((struct xtcpcb *) xig)->xt_tp),
+        memcpy(&(nnew->pcb), &(((struct xtcpcb *) xig)->xt_inp),
                            sizeof(struct tcpcb));
 
 	nnew->inp_next = tcp_head;
diff -bru net-snmp-5.1.1/agent/mibgroup/mibII/udpTable.c new/agent/mibgroup/mibII/udpTable.c
--- net-snmp-5.1.1/agent/mibgroup/mibII/udpTable.c	Mon Jun 14 01:42:38 2004
+++ new/agent/mibgroup/mibII/udpTable.c	Mon Jun 14 23:39:22 2004
@@ -46,7 +46,7 @@
 typedef struct netsnmp_udpEntry_s netsnmp_udpEntry;
 struct netsnmp_udpEntry_s {
     mib2_udpEntry_t   entry;
-    netsnmp_udpEntry *inp_next;
+    netsnmp_udpEntry *next;
 };
 #define	UDPTABLE_ENTRY_TYPE	netsnmp_udpEntry
 #define	UDPTABLE_LOCALADDRESS	entry.udpLocalAddress 
@@ -60,16 +60,38 @@
 #define	UDPTABLE_LOCALADDRESS	dwLocalAddr
 #define	UDPTABLE_LOCALPORT	dwLocalPort 
 #define	UDPTABLE_IS_TABLE
-#else			/* everything else */
+#else
 
 #ifdef linux
 #define INP_NEXT_SYMBOL		inp_next
-#endif
 #define	UDPTABLE_ENTRY_TYPE	struct inpcb 
 #define	UDPTABLE_LOCALADDRESS	inp_laddr.s_addr 
 #define	UDPTABLE_LOCALPORT	inp_lport
 #define	UDPTABLE_IS_LINKED_LIST
 
+#else			/* everything else */
+
+typedef struct netsnmp_inpcb_s netsnmp_inpcb;
+struct netsnmp_inpcb_s {
+    struct inpcb    pcb;
+    int             state;
+    netsnmp_inpcb  *inp_next;
+};
+
+
+
+#define UDPTABLE_ENTRY_TYPE     netsnmp_inpcb
+#define UDPTABLE_STATE          state
+#define UDPTABLE_LOCALADDRESS   pcb.inp_laddr.s_addr
+#define UDPTABLE_LOCALPORT      pcb.inp_lport
+#define UDPTABLE_REMOTEADDRESS  pcb.inp_faddr.s_addr
+#define UDPTABLE_REMOTEPORT     pcb.inp_fport
+#define UDPTABLE_IS_LINKED_LIST
+#undef  INP_NEXT_SYMBOL
+#define INP_NEXT_SYMBOL         inp_next
+
+
+#endif				/* linux */
 #endif                          /* WIN32 */
 #endif                          /* solaris2 */
 #endif                          /* hpux11 */
@@ -577,7 +599,8 @@
     int      sname[] = { CTL_NET, PF_INET, IPPROTO_UDP, UDPCTL_PCBLIST };
     char     *udpcb_buf = NULL;
     struct xinpgen *xig = NULL;
-    struct inpcb   *nnew;
+    /* struct inpcb   *nnew; */
+    UDPTABLE_ENTRY_TYPE *nnew;
 
     udpTable_free(NULL, NULL);
 
@@ -597,7 +620,7 @@
      *  Unpick this into the constituent 'xinpgen' structures, and extract
      *     the 'inpcb' elements into a linked list (built in reverse)
      */
-#if 0
+/* #if 0 */
     xig = (struct xinpgen *) udpcb_buf;
     xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
 
@@ -605,13 +628,14 @@
         nnew = SNMP_MALLOC_TYPEDEF(struct inpcb);
         if (!nnew)
             break;
-        memcpy(nnew, &((struct xinpcb *) xig)->xi_inp, sizeof(struct inpcb));
+        memcpy(&(nnew->pcb), &((struct xinpcb *) xig)->xi_inp, 
+			sizeof(struct inpcb));
 
-	nnew->next = udp_head;		/* XXX - ?? Check 'next' pointer */
+	nnew->inp_next = udp_head;		
 	udp_head   = nnew;
         xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
     }
-#endif
+/* #endif */
 
     free(udpcb_buf);
     if (udp_head) {
diff -bru net-snmp-5.1.1/agent/mibgroup/mibII/var_route.c new/agent/mibgroup/mibII/var_route.c
--- net-snmp-5.1.1/agent/mibgroup/mibII/var_route.c	Tue Mar 16 00:27:45 2004
+++ new/agent/mibgroup/mibII/var_route.c	Sun Jun 13 17:28:27 2004
@@ -1663,7 +1663,6 @@
             continue;
         switch (bit) {
         case RTA_DST:
-#define satosin(sa) ((struct sockaddr_in *)(sa))
             rt->dest = satosin(sa)->sin_addr;
             gotdest = 1;
             break;
diff -bru net-snmp-5.1.1/perl/OID/OID.xs new/perl/OID/OID.xs
--- net-snmp-5.1.1/perl/OID/OID.xs	Thu Mar  4 22:54:47 2004
+++ new/perl/OID/OID.xs	Sun Jun 13 17:43:46 2004
@@ -11,7 +11,7 @@
 
 typedef struct netsnmp_oid_s {
     oid                 *name;
-    unsigned int         len;
+    size_t               len;
     oid                  namebuf[ MAX_OID_LEN ];
 } netsnmp_oid;
 
diff -bru net-snmp-5.1.1/perl/SNMP/SNMP.xs new/perl/SNMP/SNMP.xs
--- net-snmp-5.1.1/perl/SNMP/SNMP.xs	Mon Mar  8 17:51:43 2004
+++ new/perl/SNMP/SNMP.xs	Sun Jun 13 18:22:46 2004
@@ -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 *,
@@ -564,7 +564,7 @@
 __scan_num_objid (buf, objid, len)
 char *buf;
 oid *objid;
-int *len;
+size_t *len;
 {
    char *cp;
    *len = 0;
@@ -854,14 +854,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;
 
@@ -1002,7 +1002,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];
@@ -1794,7 +1794,7 @@
    netsnmp_pdu *response = NULL;
    struct bulktbl  *bt_entry;
    int	nvars = 0;
-   int	reqid;
+   long	reqid;
    int	status;
    int	i;
 
@@ -2870,7 +2870,7 @@
               if (verbose) warn("failed\n");
            }
         }
-        RETVAL = (I32)get_tree_head();
+        RETVAL = (long)get_tree_head();
         }
         OUTPUT:
         RETVAL
@@ -2893,7 +2893,7 @@
         } else {
            if (verbose) warn("Failed reading %s\n", module);
         }
-        RETVAL = (I32)get_tree_head();
+        RETVAL = (long)get_tree_head();
         }
         OUTPUT:
         RETVAL
@@ -2916,7 +2916,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;
@@ -3112,7 +3112,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];
@@ -3327,7 +3327,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];
@@ -3546,7 +3546,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];
@@ -3760,7 +3760,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;
@@ -3978,7 +3978,7 @@
 	      /* Sent okay...  Return the request ID in 'pdu' as an SvIV. */
 	      DBPRT(1,(DBOUT "Okay, request id is %d\n", (int)pdu));
 /*	      XSRETURN_IV((int)pdu); */
-	      XPUSHs(sv_2mortal(newSViv((int)pdu)));
+	      XPUSHs(sv_2mortal(newSViv((long)pdu)));
 	      XSRETURN(1);
 	   }
 
@@ -4071,7 +4071,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;
@@ -4210,7 +4210,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 *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;
@@ -4578,7 +4578,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 -bru net-snmp-5.1.1/perl/agent/agent.xs new/perl/agent/agent.xs
--- net-snmp-5.1.1/perl/agent/agent.xs	Thu Mar  4 22:54:48 2004
+++ new/perl/agent/agent.xs	Sun Jun 13 17:45:46 2004
@@ -213,19 +213,19 @@
         PUSHMARK(sp);
         rarg = newSViv(0);
         arg = newSVrv(rarg, "NetSNMP::agent::netsnmp_mib_handler");
-        sv_setiv(arg, (int) handler);
+        sv_setiv(arg, (long) handler);
         XPUSHs(rarg);
         rarg = newSViv(0);
         arg = newSVrv(rarg, "NetSNMP::agent::reginfo");
-        sv_setiv(arg, (int) reginfo);
+        sv_setiv(arg, (long) reginfo);
         XPUSHs(rarg);
         rarg = newSViv(0);
         arg = newSVrv(rarg, "NetSNMP::agent::netsnmp_agent_request_info");
-        sv_setiv(arg, (int) reqinfo);
+        sv_setiv(arg, (long) reqinfo);
         XPUSHs(rarg);
         rarg = newSViv(0);
         arg = newSVrv(rarg, "NetSNMP::agent::netsnmp_request_infoPtr");
-        sv_setiv(arg, (int) requests);
+        sv_setiv(arg, (long) requests);
         XPUSHs(rarg);
         PUTBACK;
         if (SvTYPE(cb) == SVt_PVCV) {
@@ -373,7 +373,7 @@
 
         rarg = newSViv((int) 0);
         arg = newSVrv(rarg, "netsnmp_oidPtr");
-        sv_setiv(arg, (int) o);
+        sv_setiv(arg, (long) o);
 
         XPUSHs(rarg);
 
@@ -412,7 +412,7 @@
 
         rarg = newSViv((int) 0);
         arg = newSVrv(rarg, "netsnmp_oidPtr");
-        sv_setiv(arg, (int) o);
+        sv_setiv(arg, (long) o);
 
         XPUSHs(rarg);
 
@@ -753,7 +753,7 @@
                 request = request->next;
                 rarg = newSViv(0);
                 arg = newSVrv(rarg, "NetSNMP::agent::netsnmp_request_infoPtr");
-                sv_setiv(arg, (int) request);
+                sv_setiv(arg, (long) request);
                 ST(0) = rarg;
             } else {
                 ST(0) = &sv_undef;
diff -bru net-snmp-5.1.1/snmplib/container.c new/snmplib/container.c
--- net-snmp-5.1.1/snmplib/container.c	Mon Feb 23 07:00:18 2004
+++ new/snmplib/container.c	Sun Jun 13 17:11:11 2004
@@ -28,7 +28,7 @@
     if (data->name != NULL) {
         DEBUGMSGTL(("container", "  _factory_free_list() called for %s\n",
                     data->name));
-	free((const void*)data->name); /* SNMP_FREE wasted on object about to be freed */
+	free((void*)data->name); /* SNMP_FREE wasted on object about to be freed */
     }
     free(data); /* SNMP_FREE wasted on param */
 }
diff -bru net-snmp-5.1.1/snmplib/md5.c new/snmplib/md5.c
--- net-snmp-5.1.1/snmplib/md5.c	Tue Jun 10 00:47:21 2003
+++ new/snmplib/md5.c	Sat Jun 12 02:55:03 2004
@@ -463,7 +463,9 @@
         goto update_end;
 
     i = len;
-    if (((unsigned int) data) % sizeof(long) != 0) {
+/* XXX conversion */
+/*    if (((unsigned int) data) % sizeof(long) != 0) { */
+    if (((unsigned long) data) % sizeof(long) != 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 -bru net-snmp-5.1.1/snmplib/scapi.c new/snmplib/scapi.c
--- net-snmp-5.1.1/snmplib/scapi.c	Thu Mar 11 00:09:45 2004
+++ new/snmplib/scapi.c	Sun Jun 13 16:59:28 2004
@@ -250,7 +250,7 @@
 
     u_char          buf[SNMP_MAXBUF_SMALL];
 #if  defined(USE_OPENSSL) || defined(USE_PKCS)
-    size_t             buf_len = sizeof(buf);
+    u_int           buf_len = sizeof(buf);
 #endif
 
     DEBUGTRACE;
@@ -429,10 +429,10 @@
     EVP_DigestFinal(cptr, MAC, MAC_len);
 #else /* !OLD_DES */
     if (SSLeay() < 0x907000) {
-        EVP_DigestFinal(cptr, MAC, MAC_len);
+        EVP_DigestFinal(cptr, MAC, &MAC_len);
         free(cptr);
     } else {
-        EVP_DigestFinal_ex(cptr, MAC, MAC_len);
+        EVP_DigestFinal_ex(cptr, MAC, &MAC_len);
         EVP_MD_CTX_cleanup(cptr);
     }
 #endif                          /* OLD_DES */
diff -bru net-snmp-5.1.1/snmplib/snmpTCPIPv6Domain.c new/snmplib/snmpTCPIPv6Domain.c
--- net-snmp-5.1.1/snmplib/snmpTCPIPv6Domain.c	Mon Jun 14 01:42:38 2004
+++ new/snmplib/snmpTCPIPv6Domain.c	Sun Jun 13 17:06:19 2004
@@ -85,7 +85,7 @@
 #ifndef NI_WITHSCOPEID
 #define NI_WITHSCOPEID 0
 #endif
-	if (getnameinfo(to, sizeof(struct sockaddr_in6), tmp, sizeof(tmp),
+	if (getnameinfo((struct sockadr*)to, sizeof(struct sockaddr_in6), tmp, sizeof(tmp),
 			NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID)) {
 	    return strdup("UDP/IPv6: unknown");
 	}
diff -bru net-snmp-5.1.1/snmplib/snmpUDPIPv6Domain.c new/snmplib/snmpUDPIPv6Domain.c
--- net-snmp-5.1.1/snmplib/snmpUDPIPv6Domain.c	Mon Jun 14 01:42:38 2004
+++ new/snmplib/snmpUDPIPv6Domain.c	Sun Jun 13 17:05:01 2004
@@ -92,7 +92,7 @@
 #ifndef NI_WITHSCOPEID
 #define NI_WITHSCOPEID 0
 #endif
-	if (getnameinfo(to, sizeof(struct sockaddr_in6), tmp, sizeof(tmp),
+	if (getnameinfo((struct sockaddr*)to, sizeof(struct sockaddr_in6), tmp, sizeof(tmp),
 			NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID)) {
 	    return strdup("UDP/IPv6: unknown");
 	}
diff -bru net-snmp-5.1.1/snmplib/snmp_logging.c new/snmplib/snmp_logging.c
--- net-snmp-5.1.1/snmplib/snmp_logging.c	Mon Feb 16 21:46:06 2004
+++ new/snmplib/snmp_logging.c	Sun Jun 13 16:51:34 2004
@@ -382,7 +382,7 @@
             if (facility == -1)  return -1;
             logh->pri_max = pri_max;
             logh->token   = NULL;
-            logh->magic   = (void *)facility;
+            logh->magic   = (void *)(long)facility;
 	}
         break;
 
@@ -952,7 +952,7 @@
 	 */
     if (!(logh->imagic)) {
         const char *ident    = logh->token;
-        int   facility = (int)logh->magic;
+        long   facility = (long)logh->magic;
         if (!ident)
             ident = netsnmp_ds_get_string(NETSNMP_DS_LIBRARY_ID,
                                           NETSNMP_DS_LIB_APPTYPE);
diff -bru net-snmp-5.1.1/snmplib/system.c new/snmplib/system.c
--- net-snmp-5.1.1/snmplib/system.c	Thu Feb 26 06:43:26 2004
+++ new/snmplib/system.c	Sun Jun 13 16:46:53 2004
@@ -710,7 +710,7 @@
 
     len = sizeof(boottime);
 
-    sysctl(mib, 2, &boottime, &len, NULL, NULL);
+    sysctl(mib, 2, &boottime, &len, NULL, 0);
     boottime_csecs = (boottime.tv_sec * 100) + (boottime.tv_usec / 10000);
 #else                           /* CAN_USE_SYSCTL */
     if ((kmem = open("/dev/kmem", 0)) < 0)
diff -bru net-snmp-5.1.1/include/net-snmp/agent/row_merge.h new/net-snmp-5.1.1/include/net-snmp/agent/row_merge.h
--- net-snmp-5.1.1/include/net-snmp/agent/row_merge.h	Wed May 28 14:14:32 2003
+++ new/net-snmp-5.1.1/include/net-snmp/agent/row_merge.h	Sat Jun 12 02:50:02 2004
@@ -11,7 +11,7 @@
 extern          "C" {
 #endif
 
-    netsnmp_mib_handler *netsnmp_get_row_merge_handler(int);
+    netsnmp_mib_handler *netsnmp_get_row_merge_handler(long);
     int   netsnmp_register_row_merge(netsnmp_handler_registration *reginfo);
     void  netsnmp_init_row_merge(void);
 
