net/tcp: Zero keeptimer in case caller set keepalive to false

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-05-19 01:59:12 +08:00 committed by Alan Carvalho de Assis
parent 1ec70bc704
commit 753aa98ca7
1 changed files with 2 additions and 5 deletions

View File

@ -129,11 +129,8 @@ int tcp_setsockopt(FAR struct socket *psock, int option,
/* Reset timer */
if (conn->keepalive)
{
conn->keeptimer = conn->keepidle;
conn->keepretries = 0;
}
conn->keeptimer = keepalive ? conn->keepidle : 0;
conn->keepretries = 0;
}
}
break;