]> git.baikalelectronics.ru Git - kernel.git/commit
VSOCK: bind to random port for VMADDR_PORT_ANY
authorLepton Wu <ytht.net@gmail.com>
Tue, 11 Dec 2018 19:12:55 +0000 (11:12 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 14 Dec 2018 22:40:19 +0000 (14:40 -0800)
commit8cbbe85e20bb05b7fd4d6e379621ea9ca44f040b
tree69c8f9edba012677a29149a7c28fe57409298402
parent897d3ea01bbf199ae701d85c1710c321c2462d9d
VSOCK: bind to random port for VMADDR_PORT_ANY

The old code always starts from fixed port for VMADDR_PORT_ANY. Sometimes
when VMM crashed, there is still orphaned vsock which is waiting for
close timer, then it could cause connection time out for new started VM
if they are trying to connect to same port with same guest cid since the
new packets could hit that orphaned vsock. We could also fix this by doing
more in vhost_vsock_reset_orphans, but any way, it should be better to start
from a random local port instead of a fixed one.

Signed-off-by: Lepton Wu <ytht.net@gmail.com>
Reviewed-by: Jorgen Hansen <jhansen@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/vmw_vsock/af_vsock.c