summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjlemon <jlemon@FreeBSD.org>2003-02-22 21:54:57 +0000
committerjlemon <jlemon@FreeBSD.org>2003-02-22 21:54:57 +0000
commite56303ef045508b5666b969dc67b9f540f4cba0c (patch)
tree79f471741da6c84d1c515c30fbee5328ea2f857f /sys
parentf1348f023381662b1304bb9fa1a9e3b671284d4d (diff)
downloadFreeBSD-src-e56303ef045508b5666b969dc67b9f540f4cba0c.zip
FreeBSD-src-e56303ef045508b5666b969dc67b9f540f4cba0c.tar.gz
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
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/tcp_input.c15
-rw-r--r--sys/netinet/tcp_reass.c15
2 files changed, 14 insertions, 16 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index 52dba70..d4b27a8 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -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 @@ findpcb:
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 @@ after_listen:
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 @@ after_listen:
tp->t_flags |= TF_ACKNOW;
tcp_output(tp);
}
- INP_UNLOCK(inp);
- return;
+ goto check_delack;
}
}
@@ -2210,7 +2208,8 @@ dodata: /* XXX */
*/
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"));
diff --git a/sys/netinet/tcp_reass.c b/sys/netinet/tcp_reass.c
index 52dba70..d4b27a8 100644
--- a/sys/netinet/tcp_reass.c
+++ b/sys/netinet/tcp_reass.c
@@ -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 @@ findpcb:
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 @@ after_listen:
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 @@ after_listen:
tp->t_flags |= TF_ACKNOW;
tcp_output(tp);
}
- INP_UNLOCK(inp);
- return;
+ goto check_delack;
}
}
@@ -2210,7 +2208,8 @@ dodata: /* XXX */
*/
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"));
OpenPOWER on IntegriCloud