We, like libsoccr handle restoring the send queue in two pieces. The
"already sent" piece is written in repair mode, to repopulate the kernel
sndbuf without actually sending new packets to the peer. The "not sent"
piece is written out of repair mode, so that we both put it into sndbuf
*and* actually send it out.
To do that we temporarily drop out of repair mode. However we do so before
we've called TCP_REPAIR_WINDOW, meaning we're doing real send()s on a real,
non-repair socket that has bad window information. That seems bad.
Despite it differing from libsoccr, move the sending of the non sent
queued data until after the *final* repair off. I strongly suspect
that both we and libsoccr were only (kind of) getting away with this
because notsent is usually 0.
This seems to fix an intermittent hang I was seeing on
migrate/iperf3_bidir6. I was seeing that perhaps 1 time in 3, or 1
time in 5 with DEBUG=1. I did observe a nonzero notsent the one time
I reproduced after I knew what I was looking for.
Signed-off-by: David Gibson