Patchwork [4/4] VSOCK: Don't reject PF_VSOCK protocol

login
register
mail settings
Submitter Andy King
Date Feb. 18, 2013, 4:04 p.m.
Message ID <1361203453-1347-5-git-send-email-acking@vmware.com>
Download mbox | patch
Permalink /patch/221414/
State Accepted
Delegated to: David Miller
Headers show

Comments

Andy King - Feb. 18, 2013, 4:04 p.m.
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>
---
 net/vmw_vsock/af_vsock.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Patch

diff --git a/net/vmw_vsock/af_vsock.c b/net/vmw_vsock/af_vsock.c
index c1b9e55..ca511c4 100644
--- a/net/vmw_vsock/af_vsock.c
+++ b/net/vmw_vsock/af_vsock.c
@@ -1860,7 +1860,7 @@  static int vsock_create(struct net *net, struct socket *sock,
 	if (!sock)
 		return -EINVAL;
 
-	if (protocol)
+	if (protocol && protocol != PF_VSOCK)
 		return -EPROTONOSUPPORT;
 
 	switch (sock->type) {