Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_stacks/rack_bbr_common.c
Show First 20 Lines • Show All 89 Lines • ▼ Show 20 Lines | |||||
#include <netinet6/in6_pcb.h> | #include <netinet6/in6_pcb.h> | ||||
#include <netinet6/ip6_var.h> | #include <netinet6/ip6_var.h> | ||||
#include <netinet/tcp.h> | #include <netinet/tcp.h> | ||||
#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/tcpip.h> | #include <netinet/tcpip.h> | ||||
#include <netinet/tcp_ecn.h> | |||||
#include <netinet/tcp_hpts.h> | #include <netinet/tcp_hpts.h> | ||||
#include <netinet/tcp_lro.h> | #include <netinet/tcp_lro.h> | ||||
#include <netinet/cc/cc.h> | #include <netinet/cc/cc.h> | ||||
#include <netinet/tcp_log_buf.h> | #include <netinet/tcp_log_buf.h> | ||||
#ifdef TCPDEBUG | #ifdef TCPDEBUG | ||||
#include <netinet/tcp_debug.h> | #include <netinet/tcp_debug.h> | ||||
#endif /* TCPDEBUG */ | #endif /* TCPDEBUG */ | ||||
#ifdef TCP_OFFLOAD | #ifdef TCP_OFFLOAD | ||||
▲ Show 20 Lines • Show All 749 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* The value in ret_val informs the caller | * The value in ret_val informs the caller | ||||
* if we dropped the tcb (and lock) or not. | * if we dropped the tcb (and lock) or not. | ||||
* 1 = we dropped it, 0 = the TCB is still locked | * 1 = we dropped it, 0 = the TCB is still locked | ||||
* and valid. | * and valid. | ||||
*/ | */ | ||||
void | void | ||||
ctf_challenge_ack(struct mbuf *m, struct tcphdr *th, struct tcpcb *tp, int32_t * ret_val) | ctf_challenge_ack(struct mbuf *m, struct tcphdr *th, struct tcpcb *tp, uint8_t iptos, int32_t * ret_val) | ||||
{ | { | ||||
NET_EPOCH_ASSERT(); | NET_EPOCH_ASSERT(); | ||||
KMOD_TCPSTAT_INC(tcps_badsyn); | KMOD_TCPSTAT_INC(tcps_badsyn); | ||||
if (V_tcp_insecure_syn && | if (V_tcp_insecure_syn && | ||||
SEQ_GEQ(th->th_seq, tp->last_ack_sent) && | SEQ_GEQ(th->th_seq, tp->last_ack_sent) && | ||||
SEQ_LT(th->th_seq, tp->last_ack_sent + tp->rcv_wnd)) { | SEQ_LT(th->th_seq, tp->last_ack_sent + tp->rcv_wnd)) { | ||||
tp = tcp_drop(tp, ECONNRESET); | tp = tcp_drop(tp, ECONNRESET); | ||||
*ret_val = 1; | *ret_val = 1; | ||||
ctf_do_drop(m, tp); | ctf_do_drop(m, tp); | ||||
} else { | } else { | ||||
tcp_ecn_input_syn_sent(tp, tcp_get_flags(th), iptos); | |||||
/* Send challenge ACK. */ | /* Send challenge ACK. */ | ||||
tcp_respond(tp, mtod(m, void *), th, m, tp->rcv_nxt, | tcp_respond(tp, mtod(m, void *), th, m, tp->rcv_nxt, | ||||
tp->snd_nxt, TH_ACK); | tp->snd_nxt, TH_ACK); | ||||
tp->last_ack_sent = tp->rcv_nxt; | tp->last_ack_sent = tp->rcv_nxt; | ||||
m = NULL; | m = NULL; | ||||
*ret_val = 0; | *ret_val = 0; | ||||
ctf_do_drop(m, NULL); | ctf_do_drop(m, NULL); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 180 Lines • Show Last 20 Lines |