Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/tcp_stacks/bbr.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
Show First 20 Lines • Show All 9,487 Lines • ▼ Show 20 Lines | bbr_do_fin_wait_1(struct mbuf *m, struct tcphdr *th, struct socket *so, | ||||
} | } | ||||
INP_WLOCK_ASSERT(tp->t_inpcb); | INP_WLOCK_ASSERT(tp->t_inpcb); | ||||
if (ctf_drop_checks(to, m, th, tp, &tlen, &thflags, &drop_hdrlen, &ret_val)) { | if (ctf_drop_checks(to, m, th, tp, &tlen, &thflags, &drop_hdrlen, &ret_val)) { | ||||
return (ret_val); | return (ret_val); | ||||
} | } | ||||
/* | /* | ||||
* If new data are received on a connection after the user processes | * If new data are received on a connection after the user processes | ||||
* are gone, then RST the other end. | * are gone, then RST the other end. | ||||
*/ | |||||
if ((so->so_state & SS_NOFDREF) && tlen) { | |||||
/* | |||||
* We call a new function now so we might continue and setup | * We call a new function now so we might continue and setup | ||||
* to reset at all data being ack'd. | * to reset at all data being ack'd. | ||||
*/ | */ | ||||
if (bbr_check_data_after_close(m, bbr, tp, &tlen, th, so)) | if (tp->t_state > TCPS_CLOSE_WAIT && tlen && | ||||
(bbr_check_data_after_close(m, bbr, tp, &tlen, th, so)) | |||||
return (1); | return (1); | ||||
} | |||||
/* | /* | ||||
* If last ACK falls within this segment's sequence numbers, record | * If last ACK falls within this segment's sequence numbers, record | ||||
* its timestamp. NOTE: 1) That the test incorporates suggestions | * its timestamp. NOTE: 1) That the test incorporates suggestions | ||||
* from the latest proposal of the tcplw@cray.com list (Braden | * from the latest proposal of the tcplw@cray.com list (Braden | ||||
* 1993/04/26). 2) That updating only on newer timestamps interferes | * 1993/04/26). 2) That updating only on newer timestamps interferes | ||||
* with our earlier PAWS tests, so this check should be solely | * with our earlier PAWS tests, so this check should be solely | ||||
* predicated on the sequence space of this segment. 3) That we | * predicated on the sequence space of this segment. 3) That we | ||||
* modify the segment boundary check to be Last.ACK.Sent <= SEG.SEQ | * modify the segment boundary check to be Last.ACK.Sent <= SEG.SEQ | ||||
▲ Show 20 Lines • Show All 102 Lines • ▼ Show 20 Lines | bbr_do_closing(struct mbuf *m, struct tcphdr *th, struct socket *so, | ||||
} | } | ||||
INP_WLOCK_ASSERT(tp->t_inpcb); | INP_WLOCK_ASSERT(tp->t_inpcb); | ||||
if (ctf_drop_checks(to, m, th, tp, &tlen, &thflags, &drop_hdrlen, &ret_val)) { | if (ctf_drop_checks(to, m, th, tp, &tlen, &thflags, &drop_hdrlen, &ret_val)) { | ||||
return (ret_val); | return (ret_val); | ||||
} | } | ||||
/* | /* | ||||
* If new data are received on a connection after the user processes | * If new data are received on a connection after the user processes | ||||
* are gone, then RST the other end. | * are gone, then RST the other end. | ||||
*/ | |||||
if ((so->so_state & SS_NOFDREF) && tlen) { | |||||
/* | |||||
* We call a new function now so we might continue and setup | * We call a new function now so we might continue and setup | ||||
* to reset at all data being ack'd. | * to reset at all data being ack'd. | ||||
*/ | */ | ||||
if (bbr_check_data_after_close(m, bbr, tp, &tlen, th, so)) | if (tp->t_state > TCPS_CLOSE_WAIT && tlen && | ||||
(bbr_check_data_after_close(m, bbr, tp, &tlen, th, so)) | |||||
return (1); | return (1); | ||||
} | |||||
/* | /* | ||||
* If last ACK falls within this segment's sequence numbers, record | * If last ACK falls within this segment's sequence numbers, record | ||||
* its timestamp. NOTE: 1) That the test incorporates suggestions | * its timestamp. NOTE: 1) That the test incorporates suggestions | ||||
* from the latest proposal of the tcplw@cray.com list (Braden | * from the latest proposal of the tcplw@cray.com list (Braden | ||||
* 1993/04/26). 2) That updating only on newer timestamps interferes | * 1993/04/26). 2) That updating only on newer timestamps interferes | ||||
* with our earlier PAWS tests, so this check should be solely | * with our earlier PAWS tests, so this check should be solely | ||||
* predicated on the sequence space of this segment. 3) That we | * predicated on the sequence space of this segment. 3) That we | ||||
* modify the segment boundary check to be Last.ACK.Sent <= SEG.SEQ | * modify the segment boundary check to be Last.ACK.Sent <= SEG.SEQ | ||||
▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | bbr_do_lastack(struct mbuf *m, struct tcphdr *th, struct socket *so, | ||||
} | } | ||||
INP_WLOCK_ASSERT(tp->t_inpcb); | INP_WLOCK_ASSERT(tp->t_inpcb); | ||||
if (ctf_drop_checks(to, m, th, tp, &tlen, &thflags, &drop_hdrlen, &ret_val)) { | if (ctf_drop_checks(to, m, th, tp, &tlen, &thflags, &drop_hdrlen, &ret_val)) { | ||||
return (ret_val); | return (ret_val); | ||||
} | } | ||||
/* | /* | ||||
* If new data are received on a connection after the user processes | * If new data are received on a connection after the user processes | ||||
* are gone, then RST the other end. | * are gone, then RST the other end. | ||||
*/ | |||||
if ((so->so_state & SS_NOFDREF) && tlen) { | |||||
/* | |||||
* We call a new function now so we might continue and setup | * We call a new function now so we might continue and setup | ||||
* to reset at all data being ack'd. | * to reset at all data being ack'd. | ||||
*/ | */ | ||||
if (bbr_check_data_after_close(m, bbr, tp, &tlen, th, so)) | if (tp->t_state > TCPS_CLOSE_WAIT && tlen && | ||||
(bbr_check_data_after_close(m, bbr, tp, &tlen, th, so)) | |||||
return (1); | return (1); | ||||
} | |||||
/* | /* | ||||
* If last ACK falls within this segment's sequence numbers, record | * If last ACK falls within this segment's sequence numbers, record | ||||
* its timestamp. NOTE: 1) That the test incorporates suggestions | * its timestamp. NOTE: 1) That the test incorporates suggestions | ||||
* from the latest proposal of the tcplw@cray.com list (Braden | * from the latest proposal of the tcplw@cray.com list (Braden | ||||
* 1993/04/26). 2) That updating only on newer timestamps interferes | * 1993/04/26). 2) That updating only on newer timestamps interferes | ||||
* with our earlier PAWS tests, so this check should be solely | * with our earlier PAWS tests, so this check should be solely | ||||
* predicated on the sequence space of this segment. 3) That we | * predicated on the sequence space of this segment. 3) That we | ||||
* modify the segment boundary check to be Last.ACK.Sent <= SEG.SEQ | * modify the segment boundary check to be Last.ACK.Sent <= SEG.SEQ | ||||
▲ Show 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | bbr_do_fin_wait_2(struct mbuf *m, struct tcphdr *th, struct socket *so, | ||||
INP_WLOCK_ASSERT(tp->t_inpcb); | INP_WLOCK_ASSERT(tp->t_inpcb); | ||||
if (ctf_drop_checks(to, m, th, tp, &tlen, &thflags, &drop_hdrlen, &ret_val)) { | if (ctf_drop_checks(to, m, th, tp, &tlen, &thflags, &drop_hdrlen, &ret_val)) { | ||||
return (ret_val); | return (ret_val); | ||||
} | } | ||||
/* | /* | ||||
* If new data are received on a connection after the user processes | * If new data are received on a connection after the user processes | ||||
* are gone, then we may RST the other end depending on the outcome | * are gone, then we may RST the other end depending on the outcome | ||||
* of bbr_check_data_after_close. | * of bbr_check_data_after_close. | ||||
*/ | |||||
if ((so->so_state & SS_NOFDREF) && | |||||
tlen) { | |||||
/* | |||||
* We call a new function now so we might continue and setup | * We call a new function now so we might continue and setup | ||||
* to reset at all data being ack'd. | * to reset at all data being ack'd. | ||||
*/ | */ | ||||
if (bbr_check_data_after_close(m, bbr, tp, &tlen, th, so)) | if (tp->t_state > TCPS_CLOSE_WAIT && tlen && | ||||
(bbr_check_data_after_close(m, bbr, tp, &tlen, th, so)) | |||||
return (1); | return (1); | ||||
} | |||||
INP_WLOCK_ASSERT(tp->t_inpcb); | |||||
/* | /* | ||||
* If last ACK falls within this segment's sequence numbers, record | * If last ACK falls within this segment's sequence numbers, record | ||||
* its timestamp. NOTE: 1) That the test incorporates suggestions | * its timestamp. NOTE: 1) That the test incorporates suggestions | ||||
* from the latest proposal of the tcplw@cray.com list (Braden | * from the latest proposal of the tcplw@cray.com list (Braden | ||||
* 1993/04/26). 2) That updating only on newer timestamps interferes | * 1993/04/26). 2) That updating only on newer timestamps interferes | ||||
* with our earlier PAWS tests, so this check should be solely | * with our earlier PAWS tests, so this check should be solely | ||||
* predicated on the sequence space of this segment. 3) That we | * predicated on the sequence space of this segment. 3) That we | ||||
* modify the segment boundary check to be Last.ACK.Sent <= SEG.SEQ | * modify the segment boundary check to be Last.ACK.Sent <= SEG.SEQ | ||||
▲ Show 20 Lines • Show All 5,034 Lines • Show Last 20 Lines |