From: Maxime Coquelin Date: Mon, 1 Feb 2021 09:33:17 +0000 (+0100) Subject: net/virtio: fix listen file initialization X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=0ea5be8d250408b0b6c6ae2105aabc5b73978f3e;p=dpdk.git net/virtio: fix listen file initialization When running in client mode, the listen file descriptor is not initialized, and so has value 0. At destroy time, the listen FD is closed if its value is greater than or equal to zero, which causes STDIN to be closed. Bugzilla ID: 630 Fixes: 949735312f5e ("net/virtio: move vhost-user specifics to its backend") Reported-by: Jun W Zhou Signed-off-by: Maxime Coquelin Reviewed-by: David Marchand Tested-by: Jun W Zhou --- diff --git a/drivers/net/virtio/virtio_user/vhost_user.c b/drivers/net/virtio/virtio_user/vhost_user.c index ec2c53c8fb..f8569f6e6f 100644 --- a/drivers/net/virtio/virtio_user/vhost_user.c +++ b/drivers/net/virtio/virtio_user/vhost_user.c @@ -831,6 +831,7 @@ vhost_user_setup(struct virtio_user_dev *dev) dev->backend_data = data; data->vhostfd = -1; + data->listenfd = -1; fd = socket(AF_UNIX, SOCK_STREAM, 0); if (fd < 0) {