1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-24 22:13:52 +01:00

Merge pull request #12131 from brummer-simon/gnrc_tcp-release_after_failed_send

gnrc_tcp - Release pakets on failed gnrc_netapi_send()
This commit is contained in:
benpicco 2019-09-03 15:59:21 +02:00 committed by GitHub
commit 7f487ac807
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 2 deletions

View File

@ -224,7 +224,10 @@ static int _receive(gnrc_pktsnip_t *pkt)
DEBUG("gnrc_tcp_eventloop.c : _receive() : Can't find fitting tcb\n");
if ((ctl & MSK_RST) != MSK_RST) {
_pkt_build_reset_from_pkt(&reset, pkt);
gnrc_netapi_send(gnrc_tcp_pid, reset);
if (gnrc_netapi_send(gnrc_tcp_pid, reset) < 1) {
DEBUG("gnrc_tcp_eventloop.c : _receive() : unable to send reset paket\n");
gnrc_pktbuf_release(reset);
}
}
gnrc_pktbuf_release(pkt);
return -ENOTCONN;

View File

@ -271,7 +271,10 @@ int _pkt_send(gnrc_tcp_tcb_t *tcb, gnrc_pktsnip_t *out_pkt, const uint16_t seq_c
}
/* Pass packet down the network stack */
gnrc_netapi_send(gnrc_tcp_pid, out_pkt);
if (gnrc_netapi_send(gnrc_tcp_pid, out_pkt) < 1) {
DEBUG("gnrc_tcp_pkt.c : _pkt_send() : unable to send packet\n");
gnrc_pktbuf_release(out_pkt);
}
return 0;
}