diff options
author | Andre Oppermann <andre@FreeBSD.org> | 2007-07-28 12:20:39 +0000 |
---|---|---|
committer | Andre Oppermann <andre@FreeBSD.org> | 2007-07-28 12:20:39 +0000 |
commit | 773673c133e361022bbc6c87f7fdfb3c18d5022f (patch) | |
tree | 8cd4c75d9f5a3515ad698efe3302500a3c8e0345 /sys/netinet/tcp_subr.c | |
parent | cdaf208d09a56721a017454c4967f7d2599aa599 (diff) | |
download | src-773673c133e361022bbc6c87f7fdfb3c18d5022f.tar.gz src-773673c133e361022bbc6c87f7fdfb3c18d5022f.zip |
Provide a sysctl to toggle reporting of TCP debug logging:
sys.net.inet.tcp.log_debug = 1
It defaults to enabled for the moment and is to be turned off for
the next release like other diagnostics from development branches.
It is important to note that sysctl sys.net.inet.tcp.log_in_vain
uses the same logging function as log_debug. Enabling of the former
also causes the latter to engage, but not vice versa.
Use consistent terminology in tcp log messages:
"ignored" means a segment contains invalid flags/information and
is dropped without changing state or issuing a reply.
"rejected" means a segments contains invalid flags/information but
is causing a reply (usually RST) and may cause a state change.
Approved by: re (rwatson)
Notes
Notes:
svn path=/head/; revision=171640
Diffstat (limited to 'sys/netinet/tcp_subr.c')
-rw-r--r-- | sys/netinet/tcp_subr.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/netinet/tcp_subr.c b/sys/netinet/tcp_subr.c index 16d4d92d5074..963563d36b3e 100644 --- a/sys/netinet/tcp_subr.c +++ b/sys/netinet/tcp_subr.c @@ -133,6 +133,10 @@ int tcp_do_rfc1323 = 1; SYSCTL_INT(_net_inet_tcp, TCPCTL_DO_RFC1323, rfc1323, CTLFLAG_RW, &tcp_do_rfc1323, 0, "Enable rfc1323 (high performance TCP) extensions"); +static int tcp_log_debug = 1; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, log_debug, CTLFLAG_RW, + &tcp_log_debug, 0, "Log errors caused by incoming TCP segments"); + static int tcp_tcbhashsize = 0; SYSCTL_INT(_net_inet_tcp, OID_AUTO, tcbhashsize, CTLFLAG_RDTUN, &tcp_tcbhashsize, 0, "Size of TCP control-block hashtable"); @@ -2094,6 +2098,10 @@ tcp_log_addrs(struct in_conninfo *inc, struct tcphdr *th, void *ip4hdr, 2 * INET_ADDRSTRLEN; #endif /* INET6 */ + /* Is logging enabled? */ + if (tcp_log_debug == 0 && tcp_log_in_vain == 0) + return (NULL); + s = malloc(size, M_TCPLOG, M_ZERO|M_NOWAIT); if (s == NULL) return (NULL); |