[dpdk-dev] [RFC 5/5] vhost/container: change mode of vhost listening socket

Jianfeng Tan jianfeng.tan at intel.com
Thu Nov 5 19:31:16 CET 2015


Change vhost listening socket mode so that users in groups and
others can connect to vhost listening socket.

Signed-off-by: Huawei Xie <huawei.xie at intel.com>
Signed-off-by: Jianfeng Tan <jianfeng.tan at intel.com>
---
 lib/librte_vhost/vhost_user/vhost-net-user.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/librte_vhost/vhost_user/vhost-net-user.c b/lib/librte_vhost/vhost_user/vhost-net-user.c
index 2dc0547..7b24f7c 100644
--- a/lib/librte_vhost/vhost_user/vhost-net-user.c
+++ b/lib/librte_vhost/vhost_user/vhost-net-user.c
@@ -42,6 +42,7 @@
 #include <sys/un.h>
 #include <errno.h>
 #include <pthread.h>
+#include <sys/stat.h>
 
 #include <rte_log.h>
 #include <rte_virtio_net.h>
@@ -137,6 +138,10 @@ uds_socket(const char *path)
 	if (ret == -1)
 		goto err;
 
+	ret = chmod(un.sun_path, 0666);
+	if (ret == 0)
+		RTE_LOG(INFO, VHOST_CONFIG, "chmod 0666, ok\n");
+
 	return sockfd;
 
 err:
-- 
2.1.4



More information about the dev mailing list