tipc: don't send gap blocks in ACK messages
authorJon Maloy <jon.maloy@ericsson.com>
Mon, 16 Dec 2019 18:21:02 +0000 (19:21 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 17 Dec 2019 22:16:56 +0000 (14:16 -0800)
commitb7ffa045e7000d5410bf206454e0cb8de0428ed5
treed0c1c62fdd6e4c42943f6329dd3e4578696a2aba
parent2b2d81a6da783ee5771a9517fd9c394ee3fdf3ba
tipc: don't send gap blocks in ACK messages

In the commit referred to below we eliminated sending of the 'gap'
indicator in regular ACK messages, reserving this to explicit NACK
ditto.

Unfortunately we missed to also eliminate building of the 'gap block'
area in ACK messages. This area is meant to report gaps in the
received packet sequence following the initial gap, so that lost
packets can be retransmitted earlier and received out-of-sequence
packets can be released earlier. However, the interpretation of those
blocks is dependent on a complete and correct sequence of gaps and
acks. Hence, when the initial gap indicator is missing a single gap
block will be interpreted as an acknowledgment of all preceding
packets. This may lead to packets being released prematurely from the
sender's transmit queue, with easily predicatble consequences.

We now fix this by not building any gap block area if there is no
initial gap to report.

Fixes: commit 02288248b051 ("tipc: eliminate gap indicator from ACK messages")
Signed-off-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tipc/link.c