Date: Wed, 10 Oct 2007 15:46:03 -0400 From: John Baldwin <jhb@freebsd.org> To: freebsd-current@freebsd.org Cc: Michiel Boland <michiel@boland.org> Subject: Re: confusing kdump output Message-ID: <200710101546.03648.jhb@freebsd.org> In-Reply-To: <Pine.GSO.4.64.0707081716270.13175@neerbosch.nijmegen.internl.net> References: <Pine.GSO.4.64.0707081716270.13175@neerbosch.nijmegen.internl.net>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200710101546.03648.jhb>