Merge pull request #12379 from brummer-simon/gnrc_tcp-no_reopen_recv_window_on_closed_conn

gnrc_tcp: do not reopen recv window on closed connection
This commit is contained in:
Martine Lenders 2019-10-06 17:32:49 +02:00 committed by GitHub
commit 9ab67a6d89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -307,9 +307,11 @@ static int _fsm_call_recv(gnrc_tcp_tcb_t *tcb, void *buf, size_t len)
/* Read data into 'buf' up to 'len' bytes from receive buffer */ /* Read data into 'buf' up to 'len' bytes from receive buffer */
size_t rcvd = ringbuffer_get(&(tcb->rcv_buf), buf, len); size_t rcvd = ringbuffer_get(&(tcb->rcv_buf), buf, len);
/* If receive buffer can store more than GNRC_TCP_MSS: open window to available buffer size */ /* Reopen window if recv buffer can hold a MSS sized payload and FIN was not received. */
if (ringbuffer_get_free(&tcb->rcv_buf) >= GNRC_TCP_MSS) { uint16_t buf_free = ringbuffer_get_free(&tcb->rcv_buf);
tcb->rcv_wnd = ringbuffer_get_free(&(tcb->rcv_buf));
if (buf_free >= GNRC_TCP_MSS && tcb->state != FSM_STATE_CLOSE_WAIT) {
tcb->rcv_wnd = buf_free;
/* Send ACK to anounce window update */ /* Send ACK to anounce window update */
gnrc_pktsnip_t *out_pkt = NULL; gnrc_pktsnip_t *out_pkt = NULL;