Date: Sat, 10 Mar 2001 17:23:58 +0300 (MSK) From: alexs@snark.rinet.ru To: FreeBSD-gnats-submit@freebsd.org Subject: kern/25651: Syntax error in tcp_usrreq.c Message-ID: <200103101423.f2AENw900884@snark.rinet.ru>
next in thread | raw e-mail | index | archive | help
>Number: 25651
>Category: kern
>Synopsis: Syntax error in tcp_usrreq.c (COMMON_START macros)
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Sat Mar 10 06:30:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: Alex Semenyaka
>Release: FreeBSD 4.2-STABLE i386
>Organization:
Cronyx Plus ISP
>Environment:
System: FreeBSD snark.rinet.ru 4.2-STABLE FreeBSD 4.2-STABLE #2: Thu Feb 15 15:39:23 MSK 2001 root@snark.rinet.ru:/usr/obj/usr/src/sys/SNARK i386
It is box with AMD K7 Duron 700MHz, 192M of RAM
All sources has been cvsup'ed about 1 pm (GMT) from cvsup.ru.freebsd.org
(src-all, RELENG_4). Then make buildworld, make installworld has been done
without any problem.
>Description:
Sources has been updated via cvsup at 1pm March 10, 2001. Then
make buildworld
make installworld
was completed successfully. And after this attempt to do
make KERNCONF=SNARK kernel
leads to the following diagnostics:
cc -c -O -pipe -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -fformat-extensions -ansi -nostdinc -I- -I. -I../.. -I../../../include -D_KERNEL -include opt_global.h -elf -mpreferred-stack-boundary=2 ../../netinet/tcp_usrreq.c
../../netinet/tcp_usrreq.c: In function `tcp_usr_accept':
../../netinet/tcp_usrreq.c:424: syntax error before `int'
../../netinet/tcp_usrreq.c:424: `ostate' undeclared (first use in this function)
../../netinet/tcp_usrreq.c:424: (Each undeclared identifier is reported only once
../../netinet/tcp_usrreq.c:424: for each function it appears in.)
../../netinet/tcp_usrreq.c:418: warning: `tp' might be used uninitialized in this function
*** Error code 1
Stop in /usr/src/sys/compile/SNARK.
The error is generated if there is option TCPDEBUG in the kernel config,
and then works
#define TCPDEBUG0 int ostate
TCPDEBUG0 then is used in the definition of COMMON_START(). Usually
COMMON_START() is placed immidiately after the definitions, but in the
couple of places it is not the case and thus the syntax error occured.
>How-To-Repeat:
1) Update sources
2) Put option TCPDEBUG in the kernel config
3) Try to compile the kernel
>Fix:
As a workaround the following patch can be used:
--- tcp_usrreq.c.old Sat Mar 10 16:25:29 2001
+++ tcp_usrreq.c Sat Mar 10 16:16:50 2001
@@ -165,25 +165,25 @@
TCPDEBUG1();
tp = tcp_disconnect(tp);
TCPDEBUG2(PRU_DETACH);
splx(s);
return error;
}
-#define COMMON_START() TCPDEBUG0; \
- do { \
+#define COMMON_START1() do { \
if (inp == 0) { \
splx(s); \
return EINVAL; \
} \
tp = intotcpcb(inp); \
TCPDEBUG1(); \
} while(0)
+#define COMMON_START() TCPDEBUG0; COMMON_START1()
#define COMMON_END(req) out: TCPDEBUG2(req); splx(s); return error; goto out
/*
* Give the socket an address.
*/
static int
@@ -412,39 +412,43 @@
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;
+ TCPDEBUG0;
+
if (so->so_state & SS_ISDISCONNECTED) {
error = ECONNABORTED;
goto out;
}
- COMMON_START();
+ COMMON_START1();
in_setpeeraddr(so, nam);
COMMON_END(PRU_ACCEPT);
}
#ifdef INET6
static int
tcp6_usr_accept(struct socket *so, struct sockaddr **nam)
{
int s = splnet();
int error = 0;
struct inpcb *inp = sotoinpcb(so);
struct tcpcb *tp;
+ TCPDEBUG0;
+
if (so->so_state & SS_ISDISCONNECTED) {
error = ECONNABORTED;
goto out;
}
- COMMON_START();
+ COMMON_START1();
in6_mapped_peeraddr(so, nam);
COMMON_END(PRU_ACCEPT);
}
#endif /* INET6 */
/*
* Mark the connection as being incapable of further output.
*/
static int
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103101423.f2AENw900884>
