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:
commit
7f487ac807
@ -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;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user