]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mptcp: keep snd_una updated for fallback socket
authorPaolo Abeni <pabeni@redhat.com>
Fri, 7 Jan 2022 00:20:14 +0000 (16:20 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 7 Jan 2022 11:27:06 +0000 (11:27 +0000)
After shutdown, for fallback MPTCP sockets, we always have

write_seq == snd_una+1

The above will foul OUTQ ioctl(). Keep snd_una in sync with
write_seq even after shutdown.

Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/mptcp/protocol.c

index df5a0cf431c1c496c8fdc40fa60ce6336f192863..f6fc0f0f66f089d1331f5cd543bf0ad7961fa602 100644 (file)
@@ -2666,6 +2666,7 @@ static void __mptcp_check_send_data_fin(struct sock *sk)
         * state now
         */
        if (__mptcp_check_fallback(msk)) {
+               WRITE_ONCE(msk->snd_una, msk->write_seq);
                if ((1 << sk->sk_state) & (TCPF_CLOSING | TCPF_LAST_ACK)) {
                        inet_sk_state_store(sk, TCP_CLOSE);
                        mptcp_close_wake_up(sk);