Date: Wed, 28 Mar 2007 13:27:23 +0000 (UTC) From: valerio.daelli@gmail.com To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/110969: [patch] net-snmp 5.4 Message-ID: <20070328132723.CBE2113C44C@mx1.freebsd.org> Resent-Message-ID: <200703281330.l2SDU2cm018646@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 110969 >Category: ports >Synopsis: [patch] net-snmp 5.4 >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Wed Mar 28 13:30:02 GMT 2007 >Closed-Date: >Last-Modified: >Originator: Valerio Daelli >Release: FreeBSD 6.2-RELEASE-p3 amd64 >Organization: IFOM >Environment: System: FreeBSD sodio.ifom-ieo-campus.it 6.2-RELEASE-p3 FreeBSD 6.2-RELEASE-p3 #5: Fri Mar 16 15:21:33 CET 2007 root@sodio.ifom-ieo-campus.it:/usr/obj/usr/src/sys/SODIO amd64 >Description: Patch for net-snmp 5.3.1 -> 5.4 >How-To-Repeat: >Fix: --- PATCH-SNMP-5.4 begins here --- diff -ruN /usr/ports/net-mgmt/net-snmp.BAK/Makefile /usr/ports/net-mgmt/net-snmp/Makefile --- /usr/ports/net-mgmt/net-snmp.BAK/Makefile Sun Mar 25 14:35:45 2007 +++ /usr/ports/net-mgmt/net-snmp/Makefile Wed Mar 28 14:31:48 2007 @@ -6,8 +6,8 @@ # PORTNAME= snmp -PORTVERSION= 5.3.1 -PORTREVISION= 3 +PORTVERSION= 5.4 +PORTREVISION= 0 CATEGORIES= net-mgmt ipv6 MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= net-snmp @@ -81,7 +81,7 @@ PLIST_SUB+= WITH_IPV6="@comment " .endif -SHLIB_VERSION= 10 +SHLIB_VERSION= 15 PLIST_SUB+= SHLIB_VERSION=${SHLIB_VERSION} SCRIPTS_SUB= PREFIX=${PREFIX} PERL=${PERL} @@ -206,7 +206,7 @@ @${ECHO_MSG} " agent" @${ECHO_MSG} -post-patch: patch-autoconf patch-script-files +post-patch: patch-autoconf: @${AWK} '/@synopsis/,/taken from libtool.m4/' ${WRKSRC}/aclocal.m4 > ${WRKSRC}/aclocal.m4.tmp diff -ruN /usr/ports/net-mgmt/net-snmp.BAK/distinfo /usr/ports/net-mgmt/net-snmp/distinfo --- /usr/ports/net-mgmt/net-snmp.BAK/distinfo Wed Feb 28 02:17:15 2007 +++ /usr/ports/net-mgmt/net-snmp/distinfo Wed Mar 28 14:31:48 2007 @@ -1,3 +1,3 @@ -MD5 (net-snmp-5.3.1.tar.gz) = 360a9783dbc853bab6bda90d961daee5 -SHA256 (net-snmp-5.3.1.tar.gz) = fb6d5113ccdd8c4661fe5d825160e45a7c5035b145e24ec18f71a509ecb0fe43 -SIZE (net-snmp-5.3.1.tar.gz) = 4210843 +MD5 (net-snmp-5.4.tar.gz) = 46d893281056ff476e597659cb91574d +SHA256 (net-snmp-5.4.tar.gz) = 2f43cd6f3c4066f8c17fdc47931a96c1fce808c9d1dd74bcb5a79d9d29d5f947 +SIZE (net-snmp-5.4.tar.gz) = 5031685 diff -ruN /usr/ports/net-mgmt/net-snmp.BAK/files/patch-Makefile.in /usr/ports/net-mgmt/net-snmp/files/patch-Makefile.in --- /usr/ports/net-mgmt/net-snmp.BAK/files/patch-Makefile.in Wed Nov 30 06:22:40 2005 +++ /usr/ports/net-mgmt/net-snmp/files/patch-Makefile.in Wed Mar 28 14:31:48 2007 @@ -4,8 +4,8 @@ INSTALLHEADERS=version.h INCLUDESUBDIR=system INCLUDESUBDIRHEADERS= aix.h bsd.h bsdi3.h bsdi4.h bsdi.h cygwin.h \ -- darwin.h darwin7.h darwin8.h freebsd5.h freebsd6.h \ -+ darwin.h darwin7.h darwin8.h freebsd5.h freebsd6.h freebsd7.h \ +- darwin.h darwin7.h darwin8.h darwin9.h freebsd5.h freebsd6.h \ ++ darwin.h darwin7.h darwin8.h darwin9.h freebsd5.h freebsd6.h freebsd7.h \ dynix.h freebsd2.h freebsd3.h freebsd4.h freebsd.h generic.h hpux.h \ irix.h linux.h mingw32.h mips.h netbsd.h openbsd.h osf5.h \ solaris2.6.h solaris2.7.h solaris2.8.h solaris2.9.h solaris2.10.h \ diff -ruN /usr/ports/net-mgmt/net-snmp.BAK/files/patch-agent.xs /usr/ports/net-mgmt/net-snmp/files/patch-agent.xs --- /usr/ports/net-mgmt/net-snmp.BAK/files/patch-agent.xs Mon Mar 5 15:42:00 2007 +++ /usr/ports/net-mgmt/net-snmp/files/patch-agent.xs Wed Mar 28 14:31:48 2007 @@ -1,19 +1,6 @@ ---- perl/agent/agent.xs.old Fri May 26 15:16:45 2006 -+++ perl/agent/agent.xs Mon Mar 5 13:42:35 2007 -@@ -18,9 +18,9 @@ - } handler_cb_data; - - typedef struct netsnmp_oid_s { -- unsigned int *name; -- unsigned int len; -- unsigned int namebuf[ MAX_OID_LEN ]; -+ oid *name; -+ size_t len; -+ oid namebuf[ MAX_OID_LEN ]; - } netsnmp_oid; - - static int have_done_agent = 0; -@@ -569,7 +569,7 @@ +--- perl/agent/agent.xs.old Fri May 26 15:16:45 2006 ++++ perl/agent/agent.xs Mon Mar 5 13:42:35 2007 +@@ -573,7 +573,7 @@ arg = newSVrv(rarg, "netsnmp_oidPtr"); sv_setiv(arg, (IV) o); @@ -22,7 +9,7 @@ PUTBACK; i = perl_call_pv("NetSNMP::OID::newwithptr", G_SCALAR); -@@ -608,7 +608,7 @@ +@@ -612,7 +612,7 @@ arg = newSVrv(rarg, "netsnmp_oidPtr"); sv_setiv(arg, (IV) o); @@ -31,7 +18,7 @@ PUTBACK; i = perl_call_pv("NetSNMP::OID::newwithptr", G_SCALAR); -@@ -997,11 +997,13 @@ +@@ -1001,11 +1001,13 @@ rarg = newSViv(0); arg = newSVrv(rarg, "NetSNMP::agent::netsnmp_request_infoPtr"); sv_setiv(arg, (IV) request); diff -ruN /usr/ports/net-mgmt/net-snmp.BAK/files/patch-freebsd5.h /usr/ports/net-mgmt/net-snmp/files/patch-freebsd5.h --- /usr/ports/net-mgmt/net-snmp.BAK/files/patch-freebsd5.h Tue Aug 31 17:52:18 2004 +++ /usr/ports/net-mgmt/net-snmp/files/patch-freebsd5.h Wed Mar 28 14:31:48 2007 @@ -3,8 +3,6 @@ @@ -7,6 +7,7 @@ #define freebsd3 1 /* freebsd5 is a superset of freebsd4 */ - #define freebsd4 1 + #define freebsd4 freebsd4 +#define freebsd5 1 - #undef IFADDR_SYMBOL - #define IFADDR_SYMBOL "in_ifaddrhead" diff -ruN /usr/ports/net-mgmt/net-snmp.BAK/files/patch-hr_storage.c /usr/ports/net-mgmt/net-snmp/files/patch-hr_storage.c --- /usr/ports/net-mgmt/net-snmp.BAK/files/patch-hr_storage.c Wed Nov 30 06:22:40 2005 +++ /usr/ports/net-mgmt/net-snmp/files/patch-hr_storage.c Wed Mar 28 14:31:48 2007 @@ -1,221 +0,0 @@ ---- agent/mibgroup/host/hr_storage.c.orig Fri Oct 7 07:55:23 2005 -+++ agent/mibgroup/host/hr_storage.c Wed Nov 30 12:01:05 2005 -@@ -233,6 +233,10 @@ - void sol_get_swapinfo(int *, int *); - #endif - -+#if defined(__FreeBSD__) && __FreeBSD_version >= 500102 -+void collect_mbuf(long *long_mbuf, long *long_mbufc); -+#endif -+ - #define HRSTORE_MEMSIZE 1 - #define HRSTORE_INDEX 2 - #define HRSTORE_TYPE 3 -@@ -472,7 +476,8 @@ - NULL, - "Memory Buffers", /* HRS_TYPE_MBUF */ - "Real Memory", /* HRS_TYPE_MEM */ -- "Swap Space" /* HRS_TYPE_SWAP */ -+ "Swap Space", /* HRS_TYPE_SWAP */ -+ "Memory Buffer Clusters" /* HRS_TYPE_MBUFCLUSTER */ - }; - - -@@ -611,6 +616,7 @@ - storage_type_id[storage_type_len - 1] = 3; /* Virtual Mem */ - break; - case HRS_TYPE_MBUF: -+ case HRS_TYPE_MBUFCLUSTER: - storage_type_id[storage_type_len - 1] = 1; /* Other */ - break; - default: -@@ -704,7 +710,7 @@ - long_return = memory_totals.t_vm; - #endif - break; --#else /* !linux && !solaris2 && !hpux10 && !hpux11 && ... */ -+#else - case HRS_TYPE_MEM: - long_return = physmem; - break; -@@ -726,13 +732,45 @@ - i++) - long_return += mbstat.m_mtypes[i]; - #elif defined(MBSTAT_SYMBOL) && defined(STRUCT_MBSTAT_HAS_M_MBUFS) -+#if !defined(__FreeBSD__) || __FreeBSD_version < 500021 - long_return = mbstat.m_mbufs; -+#elif defined(__FreeBSD__) && __FreeBSD_version < 500024 -+ /* mbuf stats disabled */ -+ return NULL; -+#elif defined(__FreeBSD__) -+ { -+ size_t mlen = sizeof(int); -+ int nmbufs; -+ if (sysctlbyname("kern.ipc.nmbufs", &nmbufs, &mlen, -+ NULL, 0) < 0) { -+ return NULL; -+ } -+ long_return = nmbufs; -+ break; -+ } -+#else -+#error "XXX" -+ /* XXX TODO: implement new method */ -+ return NULL; -+#endif /* __FreeBSD__ */ - #elif defined(NO_DUMMY_VALUES) - goto try_next; - #else - long_return = 0; - #endif - break; -+#if defined(__FreeBSD__) && __FreeBSD_version >= 500024 -+ case HRS_TYPE_MBUFCLUSTER: { -+ size_t mlen = sizeof(int); -+ int nmbclusters; -+ if (sysctlbyname("kern.ipc.nmbclusters", &nmbclusters, &mlen, -+ NULL, 0) < 0) { -+ return NULL; -+ } -+ long_return = nmbclusters; -+ break; -+ } -+#endif - default: - #if NO_DUMMY_VALUES - goto try_next; -@@ -796,6 +834,12 @@ - #endif - #elif defined(MBSTAT_SYMBOL) && defined(STRUCT_MBSTAT_HAS_M_CLUSTERS) - long_return = mbstat.m_clusters - mbstat.m_clfree; /* unlikely, but... */ -+#elif defined(__FreeBSD__) && __FreeBSD_version < 500102 -+ /* mbuf stats disabled */ -+ return NULL; -+#elif defined(__FreeBSD__) -+ collect_mbuf((long*)&long_return, (long*)NULL); -+ break; - #elif defined(NO_DUMMY_VALUES) - goto try_next; - #else -@@ -803,6 +847,11 @@ - #endif - break; - #endif /* !linux && !solaris2 && !hpux10 && !hpux11 && ... */ -+#if defined(__FreeBSD__) && __FreeBSD_version >= 500102 -+ case HRS_TYPE_MBUFCLUSTER: -+ collect_mbuf(NULL, &long_return); -+ break; -+#endif - default: - #if NO_DUMMY_VALUES - goto try_next; -@@ -829,7 +878,11 @@ - break; - #if !defined(linux) && !defined(solaris2) && !defined(hpux10) && !defined(hpux11) && defined(MBSTAT_SYMBOL) - case HRS_TYPE_MBUF: -+#if defined(__FreeBSD__) && __FreeBSD_version >= 502113 -+ long_return = mbstat.m_mcfail + mbstat.m_mpfail; -+#else - long_return = mbstat.m_drops; -+#endif - break; - #endif /* !linux && !solaris2 && !hpux10 && !hpux11 && MBSTAT_SYMBOL */ - default: -@@ -955,3 +1008,97 @@ - *usedP = ainfo.ani_resv; - } - #endif /* solaris2 */ -+ -+#if defined(__FreeBSD__) && __FreeBSD_version >= 500102 -+void -+collect_mbuf(long *long_mbuf, long *long_mbufc) -+{ -+#if __FreeBSD_version >= 502113 -+ size_t mlen; -+ struct mbstat mbstat; -+ -+ mlen = sizeof mbstat; -+ if (sysctlbyname("kern.ipc.mbstat", &mbstat, &mlen, NULL, 0) < 0) { -+ warn("sysctl: retrieving mbstat"); -+ return; -+ } -+ if (mbstat.m_mbufs < 0) mbstat.m_mbufs = 0; /* XXX */ -+ if (mbstat.m_mclusts < 0) mbstat.m_mclusts = 0; /* XXX */ -+ if (long_mbuf) { -+ *long_mbuf = mbstat.m_mbufs; -+ } -+ if (long_mbufc) { -+ *long_mbufc = mbstat.m_mclusts; -+ } -+#else -+ int i, j, num_objs; -+ size_t mlen; -+ u_long totused[2]; -+ u_long totnum, totfree; -+ struct mbstat mbstat; -+ struct mbpstat **mbpstat = NULL; -+ -+ if (sysctlbyname("kern.ipc.mb_statpcpu", NULL, &mlen, NULL, 0) < 0) { -+ warn("sysctl: retrieving mb_statpcpu len"); -+ goto err; -+ } -+ num_objs = (int)(mlen / sizeof(struct mbpstat)); -+ if ((mbpstat = calloc(num_objs, sizeof(struct mbpstat *))) == NULL) { -+ warn("calloc: cannot allocate memory for mbpstats pointers"); -+ goto err; -+ } -+ if ((mbpstat[0] = calloc(num_objs, sizeof(struct mbpstat))) == NULL) { -+ warn("calloc: cannot allocate memory for mbpstats"); -+ goto err; -+ } -+ -+ if (sysctlbyname("kern.ipc.mb_statpcpu", mbpstat[0], &mlen, NULL, 0) < 0) { -+ warn("sysctl: retrieving mb_statpcpu"); -+ goto err; -+ } -+ mlen = sizeof mbstat; -+ if (sysctlbyname("kern.ipc.mbstat", &mbstat, &mlen, NULL, 0) < 0) { -+ warn("sysctl: retrieving mbstat"); -+ goto err; -+ } -+ -+ for (i = 0; i < num_objs; i++) -+ mbpstat[i] = mbpstat[0] + i; -+ -+#define GENLST (num_objs - 1) -+ -+ totnum = mbpstat[GENLST]->mb_mbbucks * mbstat.m_mbperbuck; -+ totfree = mbpstat[GENLST]->mb_mbfree; -+ for (i = 0; i < (num_objs - 1); i++) { -+ if (mbpstat[i]->mb_active == 0) -+ continue; -+ totnum += mbpstat[i]->mb_mbbucks * mbstat.m_mbperbuck; -+ totfree += mbpstat[i]->mb_mbfree; -+ } -+ totused[0] = totnum - totfree; -+ totnum = mbpstat[GENLST]->mb_clbucks * mbstat.m_clperbuck; -+ totfree = mbpstat[GENLST]->mb_clfree; -+ for (i = 0; i < (num_objs - 1); i++) { -+ if (mbpstat[i]->mb_active == 0) -+ continue; -+ totnum += mbpstat[i]->mb_clbucks * mbstat.m_clperbuck; -+ totfree += mbpstat[i]->mb_clfree; -+ } -+ totused[1] = totnum - totfree; -+ -+ if (long_mbuf) { -+ *long_mbuf = totused[0]; -+ } -+ if (long_mbufc) { -+ *long_mbufc = totused[1]; -+ } -+ -+ err: -+ if (mbpstat != NULL) { -+ if (mbpstat[0] != NULL) -+ free(mbpstat[0]); -+ free(mbpstat); -+ } -+#endif -+} -+#endif diff -ruN /usr/ports/net-mgmt/net-snmp.BAK/files/patch-ipv6.c /usr/ports/net-mgmt/net-snmp/files/patch-ipv6.c --- /usr/ports/net-mgmt/net-snmp.BAK/files/patch-ipv6.c Mon Nov 29 05:08:29 2004 +++ /usr/ports/net-mgmt/net-snmp/files/patch-ipv6.c Wed Mar 28 14:31:48 2007 @@ -1,5 +1,5 @@ ---- agent/mibgroup/mibII/ipv6.c.orig Thu Jul 8 05:31:54 2004 -+++ agent/mibgroup/mibII/ipv6.c Mon Oct 25 08:32:31 2004 +--- agent/mibgroup/mibII/ipv6.c.orig Tue Nov 7 00:43:27 2006 ++++ agent/mibgroup/mibII/ipv6.c Tue Mar 20 10:06:33 2007 @@ -8,10 +8,25 @@ #define _KERNEL 1 #define _I_DEFINED_KERNEL @@ -36,7 +36,7 @@ # if HAVE_NETINET_IN_PCB_H # include <netinet/in_pcb.h> # endif -@@ -575,7 +590,7 @@ +@@ -578,7 +593,7 @@ memcpy(result, &tmp, sizeof(tmp)); return 0; } @@ -45,7 +45,7 @@ q = (caddr_t) TAILQ_NEXT(&tmp, if_link); #else # if defined(__NetBSD__) || defined(__OpenBSD__) -@@ -806,7 +821,7 @@ +@@ -809,7 +824,7 @@ if (if_getifnet(interface, &ifnet) < 0) break; @@ -54,7 +54,16 @@ ifa = (caddr_t) TAILQ_FIRST(&ifnet.if_addrhead); #else # if defined(__NetBSD__) || defined(__OpenBSD__) -@@ -827,7 +842,7 @@ +@@ -823,7 +838,7 @@ + DEBUGMSGTL(("mibII/ipv6:var_ipv6", "klookup failed\n")); + break; + } +- if (!NETSNMP_KLOOKUP(ifaddr.ifa_addr, (char *) &sdl, sizeof(sdl)); ++ if (!NETSNMP_KLOOKUP(ifaddr.ifa_addr, (char *) &sdl, sizeof(sdl))) { + DEBUGMSGTL(("mibII/ipv6:var_ipv6", "klookup failed\n")); + break; + } +@@ -835,7 +850,7 @@ *var_len = sdl.sdl_alen; return (u_char *) (sdl.sdl_data + sdl.sdl_nlen); } @@ -63,7 +72,7 @@ ifa = (caddr_t) TAILQ_NEXT(&ifaddr, ifa_link); #else # if defined(__NetBSD__) || defined(__OpenBSD__) -@@ -1220,32 +1235,33 @@ +@@ -1228,32 +1243,33 @@ size_t * length, int exact, size_t * var_len, WriteMethod ** write_method) { @@ -106,7 +115,7 @@ if (!auto_nlist("udb6", (char *) &udb6, sizeof(udb6))) return NULL; p = (caddr_t) udb6.in6p_next; -@@ -1274,9 +1290,10 @@ +@@ -1282,9 +1298,10 @@ (int) vp->namelen * sizeof(oid)); DEBUGMSGTL(("mibII/ipv6", "start: p=%x\n", p)); while ( @@ -119,14 +128,14 @@ p && (u_long) p != auto_nlist_value("udb6") #else xig->xig_len > sizeof(struct xinpgen) -@@ -1284,31 +1301,32 @@ +@@ -1292,31 +1309,32 @@ ) { DEBUGMSGTL(("mibII/ipv6", "looping: p=%x\n", p)); -#if !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin) -- if (klookup((u_long) p, (char *) &in6pcb, sizeof(in6pcb)) < 0) { +- if (!NETSNMP_KLOOKUP(p, (char *) &in6pcb, sizeof(in6pcb))) { +#if OS_NOT_FREEBSD_NOR_DARWIN -+ if (klookup((u_long) p, (char *) &tstpcb, sizeof(tstpcb)) < 0) { ++ if (!NETSNMP_KLOOKUP((u_long) p, (char *) &tstpcb, sizeof(tstpcb)) < 0) { DEBUGMSGTL(("mibII/ipv6", "klookup fail for udb6 at %x\n", p)); found = 0; @@ -163,7 +172,7 @@ else newname[j++] = 0; /*XXX*/ -@@ -1319,7 +1337,7 @@ +@@ -1327,7 +1345,7 @@ result = snmp_oid_compare(name, *length, newname, j); if (exact && (result == 0)) { @@ -172,7 +181,7 @@ savnameLen = j; memcpy(savname, newname, j * sizeof(oid)); found++; -@@ -1330,7 +1348,7 @@ +@@ -1338,7 +1356,7 @@ */ if ((savnameLen == 0) || (snmp_oid_compare(savname, savnameLen, newname, j) > 0)) { @@ -181,7 +190,7 @@ savnameLen = j; memcpy(savname, newname, j * sizeof(oid)); found++; -@@ -1338,15 +1356,15 @@ +@@ -1346,15 +1364,15 @@ } skip: @@ -202,7 +211,7 @@ free(sysctl_buf); #endif DEBUGMSGTL(("mibII/ipv6", "found=%d\n", found)); -@@ -1354,7 +1372,7 @@ +@@ -1362,7 +1380,7 @@ return NULL; *length = savnameLen; memcpy((char *) name, (char *) savname, *length * sizeof(oid)); @@ -211,7 +220,7 @@ *write_method = 0; *var_len = sizeof(long); /* default to 'long' results */ -@@ -1367,14 +1385,14 @@ +@@ -1375,14 +1393,14 @@ switch (vp->magic) { case IPV6UDPLOCALADDRESS: *var_len = sizeof(struct in6_addr); @@ -230,7 +239,7 @@ else long_return = 0; /*XXX*/ return (u_char *) & long_return; -@@ -1392,24 +1410,24 @@ +@@ -1400,24 +1418,24 @@ size_t * length, int exact, size_t * var_len, WriteMethod ** write_method) { @@ -262,7 +271,7 @@ #endif if (!initialized) { -@@ -1431,11 +1449,11 @@ +@@ -1439,11 +1457,11 @@ DEBUGMSGOID(("mibII/ipv6", name, *length)); DEBUGMSG(("mibII/ipv6", " %d\n", exact)); @@ -276,7 +285,7 @@ if (!auto_nlist("tcb6", (char *) &tcb6, sizeof(tcb6))) return NULL; p = (caddr_t) tcb6.in6p_next; -@@ -1464,9 +1482,10 @@ +@@ -1472,9 +1490,10 @@ (int) vp->namelen * sizeof(oid)); DEBUGMSGTL(("mibII/ipv6", "start: p=%x\n", p)); while ( @@ -289,14 +298,12 @@ p && (u_long) p != auto_nlist_value("tcb6") #else xig->xig_len > sizeof(struct xinpgen) -@@ -1474,41 +1493,41 @@ - ) { +@@ -1483,38 +1502,38 @@ DEBUGMSGTL(("mibII/ipv6", "looping: p=%x\n", p)); --#if !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin) -- if (klookup((u_long) p, (char *) &in6pcb, sizeof(in6pcb)) < 0) { -+#if OS_NOT_FREEBSD_NOR_DARWIN -+ if (klookup((u_long) p, (char *) &tstpcb, sizeof(tstpcb)) < 0) { + #if !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin) +- if (!NETSNMP_KLOOKUP(p, (char *) &in6pcb, sizeof(in6pcb))) { ++ if (!NETSNMP_KLOOKUP(p, (char *) &tstpcb, sizeof(tstpcb))) { DEBUGMSGTL(("mibII/ipv6", "klookup fail for tcb6 at %x\n", p)); found = 0; @@ -317,10 +324,8 @@ + if (0 == (tstpcb.inp_vflag & INP_IPV6PROTO)) goto skip; #endif - if (klookup -- ((u_long) in6pcb.in6p_ppcb, (char *) &tcp6cb, sizeof(tcp6cb)) -+ ((u_long) tstpcb.in6p_ppcb, (char *) &tcp6cb, sizeof(tcp6cb)) - < 0) { +- if (!NETSNMP_KLOOKUP(in6pcb.in6p_ppcb, (char *) &tcp6cb, sizeof(tcp6cb))) { ++ if (!NETSNMP_KLOOKUP(tstpcb.in6p_ppcb, (char *) &tcp6cb, sizeof(tcp6cb))) { DEBUGMSGTL(("mibII/ipv6", "klookup fail for tcb6.tcp6cb at %x\n", - in6pcb.in6p_ppcb)); + tstpcb.in6p_ppcb)); @@ -346,7 +351,7 @@ else newname[j++] = 0; /*XXX*/ newname[j++] = tcp6statemap[tcp6cb.t_state]; -@@ -1519,13 +1538,13 @@ +@@ -1525,13 +1544,13 @@ DEBUGMSG(("mibII/ipv6", " %d\n", exact)); #if 1 /* this is very odd but sometimes happen, and cause infinite loop */ @@ -362,7 +367,7 @@ savnameLen = j; memcpy(savname, newname, j * sizeof(oid)); found++; -@@ -1536,7 +1555,7 @@ +@@ -1542,7 +1561,7 @@ */ if ((savnameLen == 0) || (snmp_oid_compare(savname, savnameLen, newname, j) > 0)) { @@ -371,7 +376,7 @@ savnameLen = j; memcpy(savname, newname, j * sizeof(oid)); found++; -@@ -1544,15 +1563,15 @@ +@@ -1550,15 +1569,15 @@ } skip: @@ -392,7 +397,7 @@ free(sysctl_buf); #endif DEBUGMSGTL(("mibII/ipv6", "found=%d\n", found)); -@@ -1573,20 +1592,20 @@ +@@ -1579,20 +1598,20 @@ switch (vp->magic) { case IPV6TCPLOCALADDR: *var_len = sizeof(struct in6_addr); @@ -419,7 +424,7 @@ else long_return = 0; /*XXX*/ return (u_char *) & long_return; -@@ -1633,22 +1652,23 @@ +@@ -1639,22 +1658,23 @@ size_t * length, int exact, size_t * var_len, WriteMethod ** write_method) { @@ -450,7 +455,7 @@ #endif DEBUGMSGTL(("mibII/ipv6", "var_tcp6: ")); -@@ -1688,9 +1708,9 @@ +@@ -1694,9 +1714,9 @@ (int) vp->namelen * sizeof(oid)); DEBUGMSGTL(("mibII/ipv6", "start: p=%x\n", p)); while ( @@ -462,14 +467,12 @@ p && (u_long) p != auto_nlist_value("tcb6") #else xig->xig_len > sizeof(struct xinpgen) -@@ -1698,41 +1718,41 @@ - ) { +@@ -1705,38 +1725,38 @@ DEBUGMSGTL(("mibII/ipv6", "looping: p=%x\n", p)); --#if !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin) -- if (klookup((u_long) p, (char *) &in6pcb, sizeof(in6pcb)) < 0) { -+#if OS_NOT_FREEBSD_NOR_DARWIN -+ if (klookup((u_long) p, (char *) &tstpcb, sizeof(in6pcb)) < 0) { + #if !(defined(__FreeBSD__) && __FreeBSD__ >= 3) && !defined(darwin) +- if (!NETSNMP_KLOOKUP(p, (char *) &in6pcb, sizeof(in6pcb))) { ++ if (!NETSNMP_KLOOKUP(p, (char *) &tstpcb, sizeof(in6pcb))) { DEBUGMSGTL(("mibII/ipv6", "klookup fail for tcb6 at %x\n", p)); found = 0; @@ -490,13 +493,10 @@ + if (0 == (tstpcb.inp_vflag & INP_IPV6PROTO)) goto skip; #endif - if (klookup -- ((u_long) in6pcb.in6p_ppcb, (char *) &tcpcb, sizeof(tcpcb)) -+ ((u_long) tstpcb.in6p_ppcb, (char *) &tcpcb, sizeof(tcpcb)) - < 0) { -- DEBUGMSGTL(("mibII/ipv6", "klookup fail for tcb6.tcpcb at %x\n", +- if (!NETSNMP_KLOOKUP(in6pcb.in6p_ppcb, (char *) &tcpcb, sizeof(tcpcb))) { ++ if (!NETSNMP_KLOOKUP(tstpcb.in6p_ppcb, (char *) &tcpcb, sizeof(tcpcb))) { + DEBUGMSGTL(("mibII/ipv6", "klookup fail for tcb6.tcpcb at %x\n", - in6pcb.in6p_ppcb)); -+ DEBUGMSGTL(("mibII/ipv6", "klookup fail for tcb6.tcp6cb at %x\n", + tstpcb.in6p_ppcb)); found = 0; break; @@ -520,7 +520,7 @@ else newname[j++] = 0; /*XXX*/ newname[j++] = mapTcpState((int)tcpcb.t_state); -@@ -1743,12 +1763,12 @@ +@@ -1747,12 +1767,12 @@ DEBUGMSG(("mibII/ipv6", " %d\n", exact)); #if 1 /* this is very odd but sometimes happen, and cause infinite loop */ @@ -535,7 +535,7 @@ savnameLen = j; memcpy(savname, newname, j * sizeof(oid)); found++; -@@ -1759,7 +1779,7 @@ +@@ -1763,7 +1783,7 @@ */ if ((savnameLen == 0) || (snmp_oid_compare(savname, savnameLen, newname, j) > 0)) { @@ -544,7 +544,7 @@ savnameLen = j; memcpy(savname, newname, j * sizeof(oid)); found++; -@@ -1767,15 +1787,15 @@ +@@ -1771,15 +1791,15 @@ } skip: @@ -565,7 +565,7 @@ free(sysctl_buf); #endif DEBUGMSGTL(("mibII/ipv6", "found=%d\n", found)); -@@ -1783,7 +1803,7 @@ +@@ -1787,7 +1807,7 @@ return NULL; *length = savnameLen; memcpy((char *) name, (char *) savname, *length * sizeof(oid)); @@ -574,7 +574,7 @@ *write_method = 0; *var_len = sizeof(long); /* default to 'long' results */ -@@ -1796,20 +1816,20 @@ +@@ -1800,20 +1820,20 @@ switch (vp->magic) { case IPV6TCPLOCALADDR: *var_len = sizeof(struct in6_addr); diff -ruN /usr/ports/net-mgmt/net-snmp.BAK/files/patch-net-snmp-config.h.in /usr/ports/net-mgmt/net-snmp/files/patch-net-snmp-config.h.in --- /usr/ports/net-mgmt/net-snmp.BAK/files/patch-net-snmp-config.h.in Sun Mar 25 14:35:45 2007 +++ /usr/ports/net-mgmt/net-snmp/files/patch-net-snmp-config.h.in Wed Mar 28 14:34:19 2007 @@ -2,10 +2,10 @@ +++ include/net-snmp/net-snmp-config.h.in Sun Mar 25 21:01:33 2007 @@ -1334,7 +1334,7 @@ - #define EXCACHETIME 30 - #define CACHEFILE ".snmp-exec-cache" --#define MAXCACHESIZE (200*80) /* roughly 200 lines max */ -+#define MAXCACHESIZE (1500*80) /* roughly 1500 lines max */ + #define NETSNMP_EXCACHETIME 30 + #define NETSNMP_CACHEFILE ".snmp-exec-cache" +-#define NETSNMP_MAXCACHESIZE (200*80) /* roughly 200 lines max */ ++#define NETSNMP_MAXCACHESIZE (1500*80) /* roughly 1500 lines max */ /* misc defaults */ diff -ruN /usr/ports/net-mgmt/net-snmp.BAK/files/patch-snmpUCDIPv6Domain.c /usr/ports/net-mgmt/net-snmp/files/patch-snmpUCDIPv6Domain.c --- /usr/ports/net-mgmt/net-snmp.BAK/files/patch-snmpUCDIPv6Domain.c Mon Nov 29 05:08:29 2004 +++ /usr/ports/net-mgmt/net-snmp/files/patch-snmpUCDIPv6Domain.c Wed Mar 28 14:31:48 2007 @@ -1,6 +1,6 @@ ---- snmplib/snmpUDPIPv6Domain.c.orig Sat Oct 16 03:52:29 2004 -+++ snmplib/snmpUDPIPv6Domain.c Mon Oct 25 09:28:10 2004 -@@ -104,13 +104,21 @@ +-- snmplib/snmpUDPIPv6Domain.c.orig Sat Oct 16 03:52:29 2004 ++++ snmplib/snmpUDPIPv6Domain.c Mon Oct 25 09:28:10 2004 +@@ -109,13 +109,21 @@ if (to == NULL) { return strdup("UDP/IPv6: unknown"); } else { @@ -8,7 +8,7 @@ - char tmp[INET6_ADDRSTRLEN + 8]; + char tmp[NI_MAXHOST]; -- sprintf(tmp, "UDP/IPv6: [%s]:%hd", +- sprintf(tmp, "UDP/IPv6: [%s]:%hu", - inet_ntop(AF_INET6, (void *) &(to->sin6_addr), addr, - INET6_ADDRSTRLEN), ntohs(to->sin6_port)); - return strdup(tmp); @@ -21,7 +21,7 @@ +#define NI_WITHSCOPEID 0 +#endif + if (getnameinfo(to, sizeof(struct sockaddr_in6), tmp, sizeof(tmp), -+ NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID)) { ++ NULL, 0, NI_NUMERICHOST | NI_WITHSCOPEID)) { + return strdup("UDP/IPv6: unknown"); + } + return strdup(tmp); diff -ruN /usr/ports/net-mgmt/net-snmp.BAK/files/patch-snmp_agent.c /usr/ports/net-mgmt/net-snmp/files/patch-snmp_agent.c --- /usr/ports/net-mgmt/net-snmp.BAK/files/patch-snmp_agent.c Wed Nov 30 06:22:40 2005 +++ /usr/ports/net-mgmt/net-snmp/files/patch-snmp_agent.c Wed Mar 28 14:31:48 2007 @@ -1,10 +1,10 @@ --- agent/snmp_agent.c.orig Thu Mar 17 17:17:43 2005 +++ agent/snmp_agent.c Wed Nov 30 12:23:41 2005 -@@ -839,6 +839,7 @@ - ; - else if (hosts_ctl("snmpd", STRING_UNKNOWN, STRING_UNKNOWN, STRING_UNKNOWN)){ - snmp_log(allow_severity, "Connection from <UNKNOWN> (%s)\n", addr_string); -+ SNMP_FREE(addr_string); +@@ -860,6 +860,7 @@ + else if (hosts_ctl(name, STRING_UNKNOWN, STRING_UNKNOWN, STRING_UNKNOWN)){ + if (!not_log_connection) { + snmp_log(allow_severity, "Connection from <UNKNOWN> (%s)\n", addr_string); ++ SNMP_FREE(addr_string); + }; addr_string = strdup("<UNKNOWN>"); } else { - snmp_log(deny_severity, "Connection from <UNKNOWN> (%s) REFUSED\n", addr_string); diff -ruN /usr/ports/net-mgmt/net-snmp.BAK/files/patch-transform_oids.h /usr/ports/net-mgmt/net-snmp/files/patch-transform_oids.h --- /usr/ports/net-mgmt/net-snmp.BAK/files/patch-transform_oids.h Wed Dec 8 12:11:27 2004 +++ /usr/ports/net-mgmt/net-snmp/files/patch-transform_oids.h Wed Mar 28 14:31:48 2007 @@ -2,10 +2,10 @@ +++ include/net-snmp/library/transform_oids.h Wed Dec 8 19:34:34 2004 @@ -23,6 +23,8 @@ /* XXX: OIDs not defined yet */ - extern oid usmAESPrivProtocol[10]; /* == { 1,3,6,1,6,3,10,1,2,4 }; */ - extern oid *usmAES128PrivProtocol; /* backwards compat */ -+extern oid *usmAES192PrivProtocol; /* backwards compat */ -+extern oid *usmAES256PrivProtocol; /* backwards compat */ + NETSNMP_IMPORT oid usmAESPrivProtocol[10]; /* == { 1,3,6,1,6,3,10,1,2,4 }; */ + NETSNMP_IMPORT oid *usmAES128PrivProtocol; /* backwards compat */ ++NETSNMP_IMPORT oid *usmAES192PrivProtocol; /* backwards compat */ ++NETSNMP_IMPORT oid *usmAES256PrivProtocol; /* backwards compat */ #define USM_AUTH_PROTO_NOAUTH_LEN 10 #define USM_AUTH_PROTO_MD5_LEN 10 diff -ruN /usr/ports/net-mgmt/net-snmp.BAK/files/patch-ucd_snmp.h /usr/ports/net-mgmt/net-snmp/files/patch-ucd_snmp.h --- /usr/ports/net-mgmt/net-snmp.BAK/files/patch-ucd_snmp.h Wed Feb 28 02:17:16 2007 +++ /usr/ports/net-mgmt/net-snmp/files/patch-ucd_snmp.h Wed Mar 28 14:31:48 2007 @@ -1,11 +0,0 @@ ---- agent/mibgroup/ucd_snmp.h.orig Tue Feb 27 20:44:04 2007 -+++ agent/mibgroup/ucd_snmp.h Tue Feb 27 20:44:20 2007 -@@ -41,6 +41,8 @@ - config_arch_require(freebsd5, ucd-snmp/memory_freebsd2) - config_arch_require(freebsd6, ucd-snmp/vmstat_freebsd2) - config_arch_require(freebsd6, ucd-snmp/memory_freebsd2) -+config_arch_require(freebsd7, ucd-snmp/vmstat_freebsd2) -+config_arch_require(freebsd7, ucd-snmp/memory_freebsd2) - config_arch_require(netbsd1, ucd-snmp/vmstat_netbsd1) - config_arch_require(netbsd1, ucd-snmp/memory_netbsd1) - config_arch_require(netbsd, ucd-snmp/vmstat_netbsd1) diff -ruN /usr/ports/net-mgmt/net-snmp.BAK/pkg-plist /usr/ports/net-mgmt/net-snmp/pkg-plist --- /usr/ports/net-mgmt/net-snmp.BAK/pkg-plist Wed Feb 28 02:17:15 2007 +++ /usr/ports/net-mgmt/net-snmp/pkg-plist Wed Mar 28 14:31:48 2007 @@ -100,6 +100,7 @@ include/net-snmp/library/snmp.h include/net-snmp/library/snmpCallbackDomain.h include/net-snmp/library/snmpTCPDomain.h +include/net-snmp/library/snmp_service.h %%WITH_IPV6%%include/net-snmp/library/snmpTCPIPv6Domain.h include/net-snmp/library/snmpUDPDomain.h %%WITH_IPV6%%include/net-snmp/library/snmpUDPIPv6Domain.h @@ -162,10 +163,10 @@ include/net-snmp/system/osf5.h include/net-snmp/system/solaris.h include/net-snmp/system/solaris2.6.h -include/net-snmp/system/solaris2.7.h -include/net-snmp/system/solaris2.8.h -include/net-snmp/system/solaris2.9.h -include/net-snmp/system/solaris2.10.h +include/net-snmp/system/darwin9.h +include/net-snmp/system/solaris2.3.h +include/net-snmp/system/solaris2.4.h +include/net-snmp/system/solaris2.5.h include/net-snmp/system/sunos.h include/net-snmp/system/svr5.h include/net-snmp/system/sysv.h @@ -206,6 +207,7 @@ %%WITH_PERL%%%%SITE_PERL%%/%%PERL_ARCH%%/NetSNMP/agent.pm %%WITH_PERL%%%%SITE_PERL%%/%%PERL_ARCH%%/NetSNMP/agent/default_store.pm %%WITH_PERL%%%%SITE_PERL%%/%%PERL_ARCH%%/NetSNMP/agent/netsnmp_request_infoPtr.pm +%%WITH_PERL%%%%SITE_PERL%%/%%PERL_ARCH%%/NetSNMP/agent/Support.pm %%WITH_PERL%%%%SITE_PERL%%/%%PERL_ARCH%%/NetSNMP/default_store.pm %%WITH_PERL%%%%SITE_PERL%%/%%PERL_ARCH%%/SNMP.pm %%WITH_PERL%%%%SITE_PERL%%/%%PERL_ARCH%%/auto/Bundle/NetSNMP/.packlist --- PATCH-SNMP-5.4 ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070328132723.CBE2113C44C>