From owner-freebsd-hackers Wed Nov 20 19:33:52 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id TAA01682 for hackers-outgoing; Wed, 20 Nov 1996 19:33:52 -0800 (PST) Received: from asstdc.scgt.oz.au (root@asstdc.scgt.oz.au [202.14.234.65]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id TAA01677 for ; Wed, 20 Nov 1996 19:33:40 -0800 (PST) Received: (from imb@localhost) by asstdc.scgt.oz.au (8.7.6/BSD4.4) id OAA02484 Thu, 21 Nov 1996 14:33:26 +1100 (EST) From: michael butler Message-Id: <199611210333.OAA02484@asstdc.scgt.oz.au> Subject: Re: Help: ucd-snmpd w/freebsd In-Reply-To: <56vo8j$irv$1@haywire.DIALix.COM> from Peter Wemm at "Nov 20, 96 08:04:35 pm" To: peter@spinner.DIALix.COM (Peter Wemm) Date: Thu, 21 Nov 1996 14:33:26 +1100 (EST) Cc: freebsd-hackers@FreeBSD.org X-Mailer: ELM [version 2.4ME+ PL28 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk Peter Wemm writes: > I ran into this when setting up mrtg, and disabled the "optimisation" in > the snmpd code. I was unsure whether to commit the patch to the ports > collection, it makes very little difference in cpu resource consumption > but certainly makes a lot of strange side effects disappear. While you're at it .. if this hasn't already been addressed, could you please fix snmpnetstat to correct the byte-order of port numbers .. *** inet.c Sat Sep 30 06:43:19 1995 --- /root/inet.c Fri Aug 2 16:15:33 1996 *************** *** 509,519 **** cp = (char *) index(line, '\0'); #endif if (!nflag && port) ! sp = getservbyport((int)port, proto); if (sp || port == 0) sprintf(cp, "%.8s", sp ? sp->s_name : "*"); else ! sprintf(cp, "%d", ntohs((u_short)port)); width = 22; printf(" %-*.*s", width, width, line); } --- 509,519 ---- cp = (char *) index(line, '\0'); #endif if (!nflag && port) ! sp = getservbyport(ntohs(port), proto); if (sp || port == 0) sprintf(cp, "%.8s", sp ? sp->s_name : "*"); else ! sprintf(cp, "%d", (u_short)port); width = 22; printf(" %-*.*s", width, width, line); }