Check to see if the TF_DELACK flag is set before returning from

tcp_input().  This unbreaks delack handling, while still preserving
correct T/TCP behavior

Tested by: maxim
Sponsored by: DARPA, NAI Labs
This commit is contained in:
Jonathan Lemon 2003-02-22 21:54:57 +00:00
parent 6fb6bfcbad
commit a14c749f04
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=111266
2 changed files with 14 additions and 16 deletions

View File

@ -162,8 +162,8 @@ do { \
* - this is a half-synchronized T/TCP connection.
*/
#define DELAY_ACK(tp) \
(((!callout_active(tp->tt_delack) && \
(tp->t_flags & TF_RXWIN0SENT) == 0)) && \
((!callout_active(tp->tt_delack) && \
(tp->t_flags & TF_RXWIN0SENT) == 0) && \
(tcp_delack_enabled || (tp->t_flags & TF_NEEDSYN)))
static int
@ -888,7 +888,7 @@ tcp_input(m, off0)
if (thflags & TH_FIN || tlen != 0)
tp->t_flags |= (TF_DELACK | TF_NEEDSYN);
else
tp->t_flags |= (TF_ACKNOW | TF_NEEDSYN);
tp->t_flags |= TF_ACKNOW;
tcpstat.tcps_connects++;
soisconnected(so);
goto trimthenstep6;
@ -1059,8 +1059,7 @@ tcp_input(m, off0)
sowwakeup(so);
if (so->so_snd.sb_cc)
(void) tcp_output(tp);
INP_UNLOCK(inp);
return;
goto check_delack;
}
} else if (th->th_ack == tp->snd_una &&
LIST_EMPTY(&tp->t_segq) &&
@ -1104,8 +1103,7 @@ tcp_input(m, off0)
tp->t_flags |= TF_ACKNOW;
tcp_output(tp);
}
INP_UNLOCK(inp);
return;
goto check_delack;
}
}
@ -2210,7 +2208,8 @@ tcp_input(m, off0)
*/
if (needoutput || (tp->t_flags & TF_ACKNOW))
(void) tcp_output(tp);
else if (tp->t_flags & TF_DELACK) {
check_delack:
if (tp->t_flags & TF_DELACK) {
tp->t_flags &= ~TF_DELACK;
KASSERT(!callout_active(tp->tt_delack),
("delayed ack already active"));

View File

@ -162,8 +162,8 @@ do { \
* - this is a half-synchronized T/TCP connection.
*/
#define DELAY_ACK(tp) \
(((!callout_active(tp->tt_delack) && \
(tp->t_flags & TF_RXWIN0SENT) == 0)) && \
((!callout_active(tp->tt_delack) && \
(tp->t_flags & TF_RXWIN0SENT) == 0) && \
(tcp_delack_enabled || (tp->t_flags & TF_NEEDSYN)))
static int
@ -888,7 +888,7 @@ tcp_input(m, off0)
if (thflags & TH_FIN || tlen != 0)
tp->t_flags |= (TF_DELACK | TF_NEEDSYN);
else
tp->t_flags |= (TF_ACKNOW | TF_NEEDSYN);
tp->t_flags |= TF_ACKNOW;
tcpstat.tcps_connects++;
soisconnected(so);
goto trimthenstep6;
@ -1059,8 +1059,7 @@ tcp_input(m, off0)
sowwakeup(so);
if (so->so_snd.sb_cc)
(void) tcp_output(tp);
INP_UNLOCK(inp);
return;
goto check_delack;
}
} else if (th->th_ack == tp->snd_una &&
LIST_EMPTY(&tp->t_segq) &&
@ -1104,8 +1103,7 @@ tcp_input(m, off0)
tp->t_flags |= TF_ACKNOW;
tcp_output(tp);
}
INP_UNLOCK(inp);
return;
goto check_delack;
}
}
@ -2210,7 +2208,8 @@ tcp_input(m, off0)
*/
if (needoutput || (tp->t_flags & TF_ACKNOW))
(void) tcp_output(tp);
else if (tp->t_flags & TF_DELACK) {
check_delack:
if (tp->t_flags & TF_DELACK) {
tp->t_flags &= ~TF_DELACK;
KASSERT(!callout_active(tp->tt_delack),
("delayed ack already active"));