From owner-freebsd-stable Sun Mar 11 21:28: 0 2001 Delivered-To: freebsd-stable@freebsd.org Received: from smtp-server1.tampabay.rr.com (smtp-server1.tampabay.rr.com [65.32.1.34]) by hub.freebsd.org (Postfix) with ESMTP id 10E2D37B719 for ; Sun, 11 Mar 2001 21:27:55 -0800 (PST) (envelope-from meconlen@obfuscated.net) Received: from clarity (24129168hfc216.tampabay.rr.com [24.129.168.216]) by smtp-server1.tampabay.rr.com (8.11.2/8.11.2) with SMTP id f2C5Rs017957 for ; Mon, 12 Mar 2001 00:27:54 -0500 (EST) From: "Michael Conlen" To: "FreeBSD Stable" Subject: TCPDEBUG Date: Mon, 12 Mar 2001 00:22:17 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) x-mimeole: Produced By Microsoft MimeOLE V5.50.4522.1200 Importance: Normal Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG With the current stable (not -current) and options TCPDEBUG in the kernel conf file I get /usr/src/sys/netinet/tcp_usrreq.c: In function `tcp_usr_accept': /usr/src/sys/netinet/tcp_usrreq.c:424: syntax error before `int' /usr/src/sys/netinet/tcp_usrreq.c:424: `ostate' undeclared (first use in this function) /usr/src/sys/netinet/tcp_usrreq.c:424: (Each undeclared identifier is reported only once /usr/src/sys/netinet/tcp_usrreq.c:424: for each function it appears in.) /usr/src/sys/netinet/tcp_usrreq.c:418: warning: `tp' might be used uninitialized in this function Investigation shows the following 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); } Line 424 is COMMON_START(); which is #define COMMON_START() TCPDEBUG0; \ do { \ if (inp == 0) { \ splx(s); \ return EINVAL; \ } \ tp = intotcpcb(inp); \ TCPDEBUG1(); \ } while(0) TCPDEBUG0 is defined with #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 Here we can see why the option in the conf file matters, however, the definition seems to be fine. Now, tracking down if it might be some other macro I only found # cd /usr/include/netinet # grep SS_ISDISCONNECTED *h # cd ../sys # grep SS_ISDISCONNECTED *h socketvar.h:#define SS_ISDISCONNECTED 0x2000 /* socket disconnected from peer */ # cd ../net # grep SS_ISDISCONNECTED *h # which doesn't seem to indicate something really nasty going on. Normally I can track down these things, but this is just weird. The only thing I can think of is that the current gcc is not accepting variables defined anywhere but the top of the function and is treating the var definition as something weird. sure enough # cat a.c main() { printf("hello world\n"); int a; a = 1; printf("hello world %d\n", a); } # cc a.c a.c: In function `main': a.c:3: syntax error before `int' a.c:4: `a' undeclared (first use in this function) a.c:4: (Each undeclared identifier is reported only once a.c:4: for each function it appears in.) # cat a.c main() { int a; printf("hello world\n"); a = 1; printf("hello world %d\n", a); } # cc a.c This seems to be the problem! -- Groove On Dude Michael Conlen Obfuscated Networking meconlen@obfuscated.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message