Skip to content

Commit d93c5d6

Browse files
rluboscfriedt
authored andcommitted
net: tcp: Fix handling of keep-alive probes
Keep-alive probes have seq number set to SND.NXT - 1 and may or may not contain an octet of data. The latter case was not handled properly therefore add a special case when validating seq number to response to keep-alive probes. Signed-off-by: Robert Lubos <[email protected]>
1 parent e717d20 commit d93c5d6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

subsys/net/ip/tcp.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2859,7 +2859,9 @@ static enum net_verdict tcp_in(struct tcp *conn, struct net_pkt *pkt)
28592859
/* send ACK for non-RST packet */
28602860
if (FL(&fl, &, RST)) {
28612861
net_stats_update_tcp_seg_rsterr(net_pkt_iface(pkt));
2862-
} else if ((len > 0) || FL(&fl, &, FIN)) {
2862+
} else if ((len > 0) || FL(&fl, &, FIN) ||
2863+
/* Keep-alive probe */
2864+
((len == 0) && FL(&fl, &, ACK))) {
28632865
tcp_out(conn, ACK);
28642866
}
28652867
k_mutex_unlock(&conn->lock);

0 commit comments

Comments
 (0)