Revert "vsock/virtio: remove socket from connected/bound list on shutdown"
This reverts commit 1fecefb092
which is
commit 3a5cc90a4d1756072619fe511d07621bdef7f120 upstream.
It needs to be reverted, as the function virtio_transport_free_pkt() is
in the stable Android ABI, and this function is removed in the 6.1.63
kernel as part of a series of fixes and optimizations of the virtio
networking connection. To preserve the ABI (and thereby keeping the
slower interface), revert the commit for now.
If this needs to come back in the future, if performance for this
interface needs to be resolved, it can be done so in an ABI-safe way.
Bug: 161946584
Change-Id: If85ca36d955d97171fe83a56888e716cc5d52ccc
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
parent
98f663d79a
commit
5418948a0a
@ -1112,17 +1112,11 @@ virtio_transport_recv_connected(struct sock *sk,
|
||||
vsk->peer_shutdown |= RCV_SHUTDOWN;
|
||||
if (le32_to_cpu(hdr->flags) & VIRTIO_VSOCK_SHUTDOWN_SEND)
|
||||
vsk->peer_shutdown |= SEND_SHUTDOWN;
|
||||
if (vsk->peer_shutdown == SHUTDOWN_MASK) {
|
||||
if (vsock_stream_has_data(vsk) <= 0 && !sock_flag(sk, SOCK_DONE)) {
|
||||
(void)virtio_transport_reset(vsk, NULL);
|
||||
virtio_transport_do_close(vsk, true);
|
||||
}
|
||||
/* Remove this socket anyway because the remote peer sent
|
||||
* the shutdown. This way a new connection will succeed
|
||||
* if the remote peer uses the same source port,
|
||||
* even if the old socket is still unreleased, but now disconnected.
|
||||
*/
|
||||
vsock_remove_sock(vsk);
|
||||
if (vsk->peer_shutdown == SHUTDOWN_MASK &&
|
||||
vsock_stream_has_data(vsk) <= 0 &&
|
||||
!sock_flag(sk, SOCK_DONE)) {
|
||||
(void)virtio_transport_reset(vsk, NULL);
|
||||
virtio_transport_do_close(vsk, true);
|
||||
}
|
||||
if (le32_to_cpu(virtio_vsock_hdr(skb)->flags))
|
||||
sk->sk_state_change(sk);
|
||||
|
Loading…
Reference in New Issue
Block a user