summaryrefslogtreecommitdiff
path: root/kernel/network/tcp.c
diff options
context:
space:
mode:
authorAnton Kling <anton@kling.gg>2024-06-26 00:33:11 +0200
committerAnton Kling <anton@kling.gg>2024-06-26 00:33:11 +0200
commit3bed68592da11f2d013f76534220275739dd7556 (patch)
tree1e3ceba0036bdf52b33b1641a46ff310c5567b21 /kernel/network/tcp.c
parentedac853e8935164113bda594865cd48c91893d11 (diff)
TCP: Increment ACK for FIN and SYN
Diffstat (limited to 'kernel/network/tcp.c')
-rw-r--r--kernel/network/tcp.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/network/tcp.c b/kernel/network/tcp.c
index 2dc7180..e42482f 100644
--- a/kernel/network/tcp.c
+++ b/kernel/network/tcp.c
@@ -241,9 +241,8 @@ void handle_tcp(ipv4_t src_ip, ipv4_t dst_ip, const u8 *payload,
con->snd_una = ack_num;
con->sent_ack = max(con->sent_ack, seq_num + tcp_payload_length);
- if (FIN & flags) {
- con->sent_ack++;
- }
+ con->sent_ack += (FIN & flags)?1:0;
+ con->sent_ack += (SYN & flags)?1:0;
switch (con->state) {
case TCP_STATE_LISTEN: {