Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_input.c
Show First 20 Lines • Show All 239 Lines • ▼ Show 20 Lines | |||||
SYSCTL_VNET_PCPUSTAT(_net_inet_tcp, TCPCTL_STATS, stats, struct tcpstat, | SYSCTL_VNET_PCPUSTAT(_net_inet_tcp, TCPCTL_STATS, stats, struct tcpstat, | ||||
tcpstat, "TCP statistics (struct tcpstat, netinet/tcp_var.h)"); | tcpstat, "TCP statistics (struct tcpstat, netinet/tcp_var.h)"); | ||||
VNET_DEFINE(counter_u64_t, tcps_states[TCP_NSTATES]); | VNET_DEFINE(counter_u64_t, tcps_states[TCP_NSTATES]); | ||||
SYSCTL_COUNTER_U64_ARRAY(_net_inet_tcp, TCPCTL_STATES, states, CTLFLAG_RD | | SYSCTL_COUNTER_U64_ARRAY(_net_inet_tcp, TCPCTL_STATES, states, CTLFLAG_RD | | ||||
CTLFLAG_VNET, &VNET_NAME(tcps_states)[0], TCP_NSTATES, | CTLFLAG_VNET, &VNET_NAME(tcps_states)[0], TCP_NSTATES, | ||||
"TCP connection counts by TCP state"); | "TCP connection counts by TCP state"); | ||||
static void | static void | ||||
tcp_vnet_init(const void *unused) | tcp_vnet_init(const void *unused) | ||||
ae: This declaration seems unnecessary. It is already defined at the line 147. | |||||
{ | { | ||||
COUNTER_ARRAY_ALLOC(V_tcps_states, TCP_NSTATES, M_WAITOK); | COUNTER_ARRAY_ALLOC(V_tcps_states, TCP_NSTATES, M_WAITOK); | ||||
VNET_PCPUSTAT_ALLOC(tcpstat, M_WAITOK); | VNET_PCPUSTAT_ALLOC(tcpstat, M_WAITOK); | ||||
} | } | ||||
VNET_SYSINIT(tcp_vnet_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, | VNET_SYSINIT(tcp_vnet_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, | ||||
tcp_vnet_init, NULL); | tcp_vnet_init, NULL); | ||||
▲ Show 20 Lines • Show All 1,289 Lines • ▼ Show 20 Lines | #endif | ||||
KASSERT(tp->t_state != TCPS_TIME_WAIT, ("%s: TCPS_TIME_WAIT", | KASSERT(tp->t_state != TCPS_TIME_WAIT, ("%s: TCPS_TIME_WAIT", | ||||
__func__)); | __func__)); | ||||
#ifdef TCPPCAP | #ifdef TCPPCAP | ||||
/* Save segment, if requested. */ | /* Save segment, if requested. */ | ||||
tcp_pcap_add(th, m, &(tp->t_inpkts)); | tcp_pcap_add(th, m, &(tp->t_inpkts)); | ||||
#endif | #endif | ||||
if ((thflags & TH_SYN) && (thflags & TH_FIN) && V_drop_synfin) { | |||||
Not Done Inline ActionsI'd like some clarifying parentheses here as well as in all the other similar if statements below. gnn: I'd like some clarifying parentheses here as well as in all the other similar if statements… | |||||
if ((s = tcp_log_addrs(inc, th, NULL, NULL))) { | |||||
log(LOG_DEBUG, "%s; %s: " | |||||
"SYN|FIN segment ignored (based on " | |||||
"sysctl setting)\n", s, __func__); | |||||
free(s, M_TCPLOG); | |||||
} | |||||
goto drop; | |||||
} | |||||
/* | /* | ||||
* Segment received on connection. | * Segment received on connection. | ||||
* Reset idle time and keep-alive timer. | * Reset idle time and keep-alive timer. | ||||
* XXX: This should be done after segment | * XXX: This should be done after segment | ||||
* validation to ignore broken/spoofed segs. | * validation to ignore broken/spoofed segs. | ||||
*/ | */ | ||||
tp->t_rcvtime = ticks; | tp->t_rcvtime = ticks; | ||||
▲ Show 20 Lines • Show All 2,334 Lines • Show Last 20 Lines |
This declaration seems unnecessary. It is already defined at the line 147.