diff options
author | des <des@FreeBSD.org> | 2007-07-30 11:06:42 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2007-07-30 11:06:42 +0000 |
commit | a969e2957be55a6de5c5d2a0466d00943b4f4c80 (patch) | |
tree | f9bf5e42e9c6d203db78a053255c80161fd541e3 /sys | |
parent | 0511205d5e160e55d9266cc7536474a1fe202ebc (diff) | |
download | FreeBSD-src-a969e2957be55a6de5c5d2a0466d00943b4f4c80.zip FreeBSD-src-a969e2957be55a6de5c5d2a0466d00943b4f4c80.tar.gz |
Make tcpstates[] static, and make sure TCPSTATES is defined before
<netinet/tcp_fsm.h> is included into any compilation unit that needs
tcpstates[]. Also remove incorrect extern declarations and TCPDEBUG
conditionals. This allows kernels both with and without TCPDEBUG to
build, and unbreaks the tinderbox.
Approved by: re (rwatson)
Diffstat (limited to 'sys')
-rw-r--r-- | sys/netinet/tcp_fsm.h | 2 | ||||
-rw-r--r-- | sys/netinet/tcp_input.c | 6 | ||||
-rw-r--r-- | sys/netinet/tcp_usrreq.c | 4 | ||||
-rw-r--r-- | sys/netipx/spx_debug.c | 2 | ||||
-rw-r--r-- | sys/netipx/spx_debug.h | 1 |
5 files changed, 3 insertions, 12 deletions
diff --git a/sys/netinet/tcp_fsm.h b/sys/netinet/tcp_fsm.h index 138d967..61fd0c1 100644 --- a/sys/netinet/tcp_fsm.h +++ b/sys/netinet/tcp_fsm.h @@ -102,7 +102,7 @@ int tcp_acounts[TCP_NSTATES][PRU_NREQ]; #endif #ifdef TCPSTATES -const char *tcpstates[] = { +static char const * const tcpstates[] = { "CLOSED", "LISTEN", "SYN_SENT", "SYN_RCVD", "ESTABLISHED", "CLOSE_WAIT", "FIN_WAIT_1", "CLOSING", "LAST_ACK", "FIN_WAIT_2", "TIME_WAIT", diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 711251e..42d8147 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -1573,15 +1573,9 @@ tcp_do_segment(struct mbuf *m, struct tcphdr *th, struct socket *so, KASSERT(headlocked, ("%s: trimthenstep6: tcp_close.3: head " "not locked", __func__)); if ((s = tcp_log_addrs(&tp->t_inpcb->inp_inc, th, NULL, NULL))) { -#ifdef TCPDEBUG log(LOG_DEBUG, "%s; %s: %s: Received data after socket " "was closed, sending RST and removing tcpcb\n", s, __func__, tcpstates[tp->t_state]); -#else - log(LOG_DEBUG, "%s; %s: Received data after socket " - "was closed, sending RST and removing tcpcb\n", - s, __func__); -#endif free(s, M_TCPLOG); } tp = tcp_close(tp); diff --git a/sys/netinet/tcp_usrreq.c b/sys/netinet/tcp_usrreq.c index 2ecbc30..79d678e 100644 --- a/sys/netinet/tcp_usrreq.c +++ b/sys/netinet/tcp_usrreq.c @@ -87,10 +87,6 @@ /* * TCP protocol interface to socket abstraction. */ -#ifdef TCPDEBUG -extern const char *tcpstates[]; -#endif - static int tcp_attach(struct socket *); static int tcp_connect(struct tcpcb *, struct sockaddr *, struct thread *td); diff --git a/sys/netipx/spx_debug.c b/sys/netipx/spx_debug.c index 1654bc0..7f48261 100644 --- a/sys/netipx/spx_debug.c +++ b/sys/netipx/spx_debug.c @@ -69,6 +69,8 @@ __FBSDID("$FreeBSD$"); #include <sys/systm.h> #include <sys/protosw.h> +#define TCPSTATES /* for logging */ + #include <netinet/in_systm.h> #include <netinet/tcp_fsm.h> diff --git a/sys/netipx/spx_debug.h b/sys/netipx/spx_debug.h index 24a76f4..24405bc 100644 --- a/sys/netipx/spx_debug.h +++ b/sys/netipx/spx_debug.h @@ -95,7 +95,6 @@ int spx_debx; #ifdef _KERNEL extern char *prurequests[]; extern char *sanames[]; -extern char *tcpstates[]; void spx_trace(short act, u_char ostate, struct spxpcb *sp, struct spx *si, int req); |