mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-14 22:32:30 +01:00
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)
This commit is contained in:
parent
ef2c8992b5
commit
218cbbea9a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=171656
@ -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",
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
@ -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>
|
||||
|
||||
|
@ -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);
|
||||
|
@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
#include <net/route.h>
|
||||
|
||||
#define TCPSTATES
|
||||
#include <netinet/tcp_fsm.h>
|
||||
|
||||
#include <netipx/ipx.h>
|
||||
@ -72,8 +73,6 @@ __FBSDID("$FreeBSD$");
|
||||
|
||||
static char *ipx_prpr (struct ipx_addr *);
|
||||
|
||||
extern char *tcpstates[];
|
||||
|
||||
/*
|
||||
* Print a summary of connections related to a Network Systems
|
||||
* protocol. For SPX, also give state of connection.
|
||||
|
Loading…
Reference in New Issue
Block a user