Date: Fri, 25 Apr 2008 12:30:12 +0000 (UTC) From: valerio.daelli@gmail.com To: FreeBSD-gnats-submit@FreeBSD.org Subject: ports/123073: [patch] fix for net-snmp 5.4 Message-ID: <20080425123013.1651A8FC18@mx1.freebsd.org> Resent-Message-ID: <200804251240.m3PCe1QE045324@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 123073 >Category: ports >Synopsis: [patch] fix for net-snmp 5.4 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: update >Submitter-Id: current-users >Arrival-Date: Fri Apr 25 12:40:00 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Valerio Daelli >Release: FreeBSD 7.0-RELEASE-p1 i386 >Organization: IFOM IEO Campus >Environment: System: FreeBSD bsd7.ifom-ieo-campus.it 7.0-RELEASE-p1 FreeBSD 7.0-RELEASE-p1 #4: Fri Apr 18 08:46:49 CEST 2008 root@bsd7.ifom-ieo-campus.it:/usr/obj/usr/src/sys/BSD7 i386 >Description: After update of net-snmp to 5.4, someone posted a problem about a missing OID (please see ports/110969). I posted a patch in that PR (the same patch attached here) and the person who raised the problem confirmed me privately that this patch fixes his problem. >How-To-Repeat: >Fix: --- NET-SNMP-MEMORY-BUFFER.patch begins here --- diff -ruN /usr/ports/net-mgmt/net-snmp.orig/files/patch-memory_freebsd.c /usr/ports/net-mgmt/net-snmp/files/patch-memory_freebsd.c --- /usr/ports/net-mgmt/net-snmp.orig/files/patch-memory_freebsd.c 1970-01-01 01:00:00.000000000 +0100 +++ /usr/ports/net-mgmt/net-snmp/files/patch-memory_freebsd.c 2008-04-14 17:03:37.000000000 +0200 @@ -0,0 +1,39 @@ +--- agent/mibgroup/hardware/memory/memory_freebsd.c.orig 2006-03-06 17:23:52.000000000 +0100 ++++ agent/mibgroup/hardware/memory/memory_freebsd.c 2008-04-14 16:45:19.000000000 +0200 +@@ -47,6 +47,9 @@ + int phys_mem_mib[] = { CTL_HW, HW_PHYSMEM }; + int user_mem_mib[] = { CTL_HW, HW_USERMEM }; + ++ long bufspace; ++ ++ + /* + * Retrieve the memory information from the underlying O/S... + */ +@@ -54,6 +57,7 @@ + sysctl(phys_mem_mib, 2, &phys_mem, &mem_size, NULL, 0); + sysctl(user_mem_mib, 2, &user_mem, &mem_size, NULL, 0); + auto_nlist(SUM_SYMBOL, (char *) &vmem, sizeof(vmem)); ++ auto_nlist(BUFSPACE_SYMBOL, (char *) &bufspace, sizeof(bufspace)); + #ifndef freebsd4 + pagesize = 1024; + #else +@@ -129,6 +133,18 @@ + mem->free = -1; + } + ++ mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_MBUF, 1 ); ++ if (!mem) { ++ snmp_log_perror("No Memory Buffer info entry"); ++ } else { ++ if (!mem->descr) ++ mem->descr = strdup("Memory Buffer"); ++ mem->units = pagesize; ++ mem->size = bufspace/pagesize; ++ mem->free = -1; ++ } ++ ++ + nswap = swapmode(pagesize); + mem = netsnmp_memory_get_byIdx( NETSNMP_MEM_TYPE_SWAP, 1 ); + if (!mem) { --- NET-SNMP-MEMORY-BUFFER.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080425123013.1651A8FC18>