net/tcp: fix missing error code propagation

If devif_send() failed its returned error code was not propagated
to user space. Instead, a send length of zero was returned (in
violation of POSIX).
This commit is contained in:
Kian Karas 2024-05-05 17:36:25 +02:00 committed by Alan Carvalho de Assis
parent 324446bbba
commit 46a8c665d7
1 changed files with 2 additions and 0 deletions

View File

@ -288,6 +288,7 @@ static uint16_t tcpsend_eventhandler(FAR struct net_driver_s *dev,
sndlen, tcpip_hdrsize(conn));
if (ret <= 0)
{
pstate->snd_sent = ret;
goto end_wait;
}
@ -374,6 +375,7 @@ static uint16_t tcpsend_eventhandler(FAR struct net_driver_s *dev,
sndlen, tcpip_hdrsize(conn));
if (ret <= 0)
{
pstate->snd_sent = ret;
goto end_wait;
}