Changeset View
Changeset View
Standalone View
Standalone View
head/sys/netinet/tcp_subr.c
Show First 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | |||||
#ifdef INET6 | #ifdef INET6 | ||||
#include <netinet/ip6.h> | #include <netinet/ip6.h> | ||||
#include <netinet6/in6_pcb.h> | #include <netinet6/in6_pcb.h> | ||||
#include <netinet6/ip6_var.h> | #include <netinet6/ip6_var.h> | ||||
#include <netinet6/scope6_var.h> | #include <netinet6/scope6_var.h> | ||||
#include <netinet6/nd6.h> | #include <netinet6/nd6.h> | ||||
#endif | #endif | ||||
#ifdef TCP_RFC7413 | |||||
#include <netinet/tcp_fastopen.h> | |||||
#endif | |||||
#include <netinet/tcp_fsm.h> | #include <netinet/tcp_fsm.h> | ||||
#include <netinet/tcp_seq.h> | #include <netinet/tcp_seq.h> | ||||
#include <netinet/tcp_timer.h> | #include <netinet/tcp_timer.h> | ||||
#include <netinet/tcp_var.h> | #include <netinet/tcp_var.h> | ||||
#include <netinet/tcp_syncache.h> | #include <netinet/tcp_syncache.h> | ||||
#ifdef INET6 | #ifdef INET6 | ||||
#include <netinet6/tcp6_var.h> | #include <netinet6/tcp6_var.h> | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 604 Lines • ▼ Show 20 Lines | #undef TCP_MINPROTOHDR | ||||
ISN_LOCK_INIT(); | ISN_LOCK_INIT(); | ||||
EVENTHANDLER_REGISTER(shutdown_pre_sync, tcp_fini, NULL, | EVENTHANDLER_REGISTER(shutdown_pre_sync, tcp_fini, NULL, | ||||
SHUTDOWN_PRI_DEFAULT); | SHUTDOWN_PRI_DEFAULT); | ||||
EVENTHANDLER_REGISTER(maxsockets_change, tcp_zone_change, NULL, | EVENTHANDLER_REGISTER(maxsockets_change, tcp_zone_change, NULL, | ||||
EVENTHANDLER_PRI_ANY); | EVENTHANDLER_PRI_ANY); | ||||
#ifdef TCPPCAP | #ifdef TCPPCAP | ||||
tcp_pcap_init(); | tcp_pcap_init(); | ||||
#endif | #endif | ||||
#ifdef TCP_RFC7413 | |||||
tcp_fastopen_init(); | |||||
#endif | |||||
} | } | ||||
#ifdef VIMAGE | #ifdef VIMAGE | ||||
void | void | ||||
tcp_destroy(void) | tcp_destroy(void) | ||||
{ | { | ||||
int error; | int error; | ||||
#ifdef TCP_RFC7413 | |||||
tcp_fastopen_destroy(); | |||||
#endif | |||||
tcp_hc_destroy(); | tcp_hc_destroy(); | ||||
syncache_destroy(); | syncache_destroy(); | ||||
tcp_tw_destroy(); | tcp_tw_destroy(); | ||||
in_pcbinfo_destroy(&V_tcbinfo); | in_pcbinfo_destroy(&V_tcbinfo); | ||||
uma_zdestroy(V_sack_hole_zone); | uma_zdestroy(V_sack_hole_zone); | ||||
uma_zdestroy(V_tcpcb_zone); | uma_zdestroy(V_tcpcb_zone); | ||||
error = hhook_head_deregister(V_tcp_hhh[HHOOK_TCP_EST_IN]); | error = hhook_head_deregister(V_tcp_hhh[HHOOK_TCP_EST_IN]); | ||||
▲ Show 20 Lines • Show All 710 Lines • ▼ Show 20 Lines | tcp_close(struct tcpcb *tp) | ||||
struct socket *so; | struct socket *so; | ||||
INP_INFO_LOCK_ASSERT(&V_tcbinfo); | INP_INFO_LOCK_ASSERT(&V_tcbinfo); | ||||
INP_WLOCK_ASSERT(inp); | INP_WLOCK_ASSERT(inp); | ||||
#ifdef TCP_OFFLOAD | #ifdef TCP_OFFLOAD | ||||
if (tp->t_state == TCPS_LISTEN) | if (tp->t_state == TCPS_LISTEN) | ||||
tcp_offload_listen_stop(tp); | tcp_offload_listen_stop(tp); | ||||
#endif | |||||
#ifdef TCP_RFC7413 | |||||
/* | |||||
* This releases the TFO pending counter resource for TFO listen | |||||
* sockets as well as passively-created TFO sockets that transition | |||||
* from SYN_RECEIVED to CLOSED. | |||||
*/ | |||||
if (tp->t_tfo_pending) { | |||||
tcp_fastopen_decrement_counter(tp->t_tfo_pending); | |||||
tp->t_tfo_pending = NULL; | |||||
} | |||||
#endif | #endif | ||||
in_pcbdrop(inp); | in_pcbdrop(inp); | ||||
TCPSTAT_INC(tcps_closed); | TCPSTAT_INC(tcps_closed); | ||||
KASSERT(inp->inp_socket != NULL, ("tcp_close: inp_socket NULL")); | KASSERT(inp->inp_socket != NULL, ("tcp_close: inp_socket NULL")); | ||||
so = inp->inp_socket; | so = inp->inp_socket; | ||||
soisdisconnected(so); | soisdisconnected(so); | ||||
if (inp->inp_flags & INP_SOCKREF) { | if (inp->inp_flags & INP_SOCKREF) { | ||||
KASSERT(so->so_state & SS_PROTOREF, | KASSERT(so->so_state & SS_PROTOREF, | ||||
▲ Show 20 Lines • Show All 1,398 Lines • Show Last 20 Lines |