瀏覽代碼

VSOCK: Don't reject PF_VSOCK protocol

Allow our own family as the protocol value for socket creation.

Reported-by: Gerd Hoffmann <kraxel@redhat.com>
Signed-off-by: Andy King <acking@vmware.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Andy King 13 年之前
父節點
當前提交
6cf1c5fc26
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      net/vmw_vsock/af_vsock.c

+ 1 - 1
net/vmw_vsock/af_vsock.c

@@ -1860,7 +1860,7 @@ static int vsock_create(struct net *net, struct socket *sock,
 	if (!sock)
 	if (!sock)
 		return -EINVAL;
 		return -EINVAL;
 
 
-	if (protocol)
+	if (protocol && protocol != PF_VSOCK)
 		return -EPROTONOSUPPORT;
 		return -EPROTONOSUPPORT;
 
 
 	switch (sock->type) {
 	switch (sock->type) {