Skip to content

Commit 46a8c66

Browse files
kk-thraneAlan Carvalho de Assis
authored andcommitted
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).
1 parent 324446b commit 46a8c66

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/tcp/tcp_send_unbuffered.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ static uint16_t tcpsend_eventhandler(FAR struct net_driver_s *dev,
288288
sndlen, tcpip_hdrsize(conn));
289289
if (ret <= 0)
290290
{
291+
pstate->snd_sent = ret;
291292
goto end_wait;
292293
}
293294

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

0 commit comments

Comments
 (0)