From owner-freebsd-bugs Mon Mar 12 20: 0:14 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 36AA237B71D for ; Mon, 12 Mar 2001 20:00:03 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f2D403378121; Mon, 12 Mar 2001 20:00:03 -0800 (PST) (envelope-from gnats) Received: from strike.velocet.ca (strike.velocet.ca [204.138.54.214]) by hub.freebsd.org (Postfix) with ESMTP id 8755237B71B for ; Mon, 12 Mar 2001 19:55:08 -0800 (PST) (envelope-from root@velocet.ca) Received: by repeat.velocet.ca (Postfix, from userid 0) id D22A7384A6; Sat, 10 Mar 2001 18:36:37 -0500 (EST) Message-Id: <20010310233637.D22A7384A6@repeat.velocet.ca> Date: Sat, 10 Mar 2001 18:36:37 -0500 (EST) From: dgilbert@velocet.ca Reply-To: dgilbert@velocet.ca To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: kern/25758: tcp_usrreq.c doesn't compile with TCPDEBUG set. Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 25758 >Category: kern >Synopsis: tcp_usrreq.c doesn't compile with TCPDEBUG set >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Mar 12 20:00:03 PST 2001 >Closed-Date: >Last-Modified: >Originator: David Gilbert >Release: FreeBSD 4.2-STABLE i386 >Organization: Velocet Communications >Environment: System: FreeBSD strike.velocet.ca 4.2-STABLE FreeBSD 4.2-STABLE #3: Sun Jan 7 23:36:46 EST 2001 root@strike.velocet.ca:/usr/src/sys/compile/STRIKE i386 >Description: The following code in tcp_usrreq.c (line 412) static int tcp_usr_accept(struct socket *so, struct sockaddr **nam) { int s = splnet(); int error = 0; struct inpcb *inp = sotoinpcb(so); struct tcpcb *tp; if (so->so_state & SS_ISDISCONNECTED) { error = ECONNABORTED; goto out; } COMMON_START(); in_setpeeraddr(so, nam); COMMON_END(PRU_ACCEPT); } invokes COMMON_START() incorrectly: #define COMMON_START() TCPDEBUG0; \ do { \ if (inp == 0) { \ splx(s); \ return EINVAL; \ } \ tp = intotcpcb(inp); \ TCPDEBUG1(); \ } while(0) Where TCPDEBUG0 is #ifdef TCPDEBUG #define TCPDEBUG0 int ostate #define TCPDEBUG1() ostate = tp ? tp->t_state : 0 #define TCPDEBUG2(req) if (tp && (so->so_options & SO_DEBUG)) \ tcp_trace(TA_USER, ostate, tp, 0, 0, req) #else #define TCPDEBUG0 #define TCPDEBUG1() #define TCPDEBUG2(req) #endif Which obviously doesn't work if TCPDEBUG is set. >How-To-Repeat: Put "options TCPDEBUG" in your kernel and try to compile >Fix: I'm not familiar with this code ... or what affects what. >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message