From owner-freebsd-current@FreeBSD.ORG Wed Oct 10 20:21:21 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2455A16A420 for ; Wed, 10 Oct 2007 20:21:21 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from speedfactory.net (mail6.speedfactory.net [66.23.216.219]) by mx1.freebsd.org (Postfix) with ESMTP id B580A13C4B8 for ; Wed, 10 Oct 2007 20:21:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (unverified [66.23.211.162]) by speedfactory.net (SurgeMail 3.8p) with ESMTP id 213848283-1834499 for multiple; Wed, 10 Oct 2007 16:19:24 -0400 Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.8/8.13.8) with ESMTP id l9AKL3aW017064; Wed, 10 Oct 2007 16:21:17 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-current@freebsd.org Date: Wed, 10 Oct 2007 15:46:03 -0400 User-Agent: KMail/1.9.6 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200710101546.03648.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Wed, 10 Oct 2007 16:21:18 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/4523/Wed Oct 10 14:30:26 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Michiel Boland Subject: Re: confusing kdump output X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Oct 2007 20:21:21 -0000 On Sunday 08 July 2007 11:21:16 am Michiel Boland wrote: > Hi. If a program does something like > > setsockopt(sock, IPPROTO_TCP, TCP_NOPUSH, &onoff, sizeof onoff) > > this is reported by kdump as > > setsockopt(0x2a,0x6,SO_REUSEADDR,0x7fffffffe32c,0x4) > > Note that it reports SO_REUSEADDR rather than TCP_NOPUSH. This is > confusing. > > It's probably a bit useless to compile all possible printable socket > options into kdump, but at least it could be made to not print a symbolic > name if the level is, say, not SOL_SOCKET. Try this: Index: kdump.c =================================================================== RCS file: /usr/cvs/src/usr.bin/kdump/kdump.c,v retrieving revision 1.37 diff -u -r1.37 kdump.c --- kdump.c 10 Jul 2007 00:01:30 -0000 1.37 +++ kdump.c 10 Oct 2007 19:43:48 -0000 @@ -532,10 +532,12 @@ print_number(ip,narg,c); (void)putchar(','); sockoptlevelname((int)*ip, decimal); - ip++; - narg--; - (void)putchar(','); - sockoptname((int)*ip); + if ((int)*ip == SOL_SOCKET) { + ip++; + narg--; + (void)putchar(','); + sockoptname((int)*ip); + } ip++; narg--; #ifdef SYS_freebsd6_lseek -- John Baldwin