bug #49631: handle zero-window probe and refused_data

This commit adds support for responding to a zero-window probe when
the refused_data pointer is set

A zero-window probe is a data segment received when rcv_ann_wnd
is 0. This corrects a standards violation where LwIP would not
respond to a zero-window probe with its current ACK value (RCV.NXT)
when it has refused data, thus leading to the probing TCP closing
out the connection
This commit is contained in:
Joel Cunningham 2016-12-09 18:10:24 -06:00
parent fcd2daf57c
commit cceea73c3f

View File

@ -358,6 +358,11 @@ tcp_input(struct pbuf *p, struct netif *inp)
((pcb->refused_data != NULL) && (tcplen > 0))) {
/* pcb has been aborted or refused data is still refused and the new
segment contains data */
if (pcb->rcv_ann_wnd == 0) {
/* this is a zero-window probe, we respond to it with current RCV.NXT
and drop the data segment */
tcp_send_empty_ack(pcb);
}
TCP_STATS_INC(tcp.drop);
MIB2_STATS_INC(mib2.tcpinerrs);
goto aborted;