Commit 8cb48554 authored by Arseny Krasnov's avatar Arseny Krasnov Committed by David S. Miller

af_vsock: update comments for stream sockets

Replace 'stream' to 'connection oriented' in comments as
SEQPACKET is also connection oriented.
Signed-off-by: default avatarArseny Krasnov <arseny.krasnov@kaspersky.com>
Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0798e78b
...@@ -415,8 +415,8 @@ static void vsock_deassign_transport(struct vsock_sock *vsk) ...@@ -415,8 +415,8 @@ static void vsock_deassign_transport(struct vsock_sock *vsk)
/* Assign a transport to a socket and call the .init transport callback. /* Assign a transport to a socket and call the .init transport callback.
* *
* Note: for stream socket this must be called when vsk->remote_addr is set * Note: for connection oriented socket this must be called when vsk->remote_addr
* (e.g. during the connect() or when a connection request on a listener * is set (e.g. during the connect() or when a connection request on a listener
* socket is received). * socket is received).
* The vsk->remote_addr is used to decide which transport to use: * The vsk->remote_addr is used to decide which transport to use:
* - remote CID == VMADDR_CID_LOCAL or g2h->local_cid or VMADDR_CID_HOST if * - remote CID == VMADDR_CID_LOCAL or g2h->local_cid or VMADDR_CID_HOST if
...@@ -470,10 +470,10 @@ int vsock_assign_transport(struct vsock_sock *vsk, struct vsock_sock *psk) ...@@ -470,10 +470,10 @@ int vsock_assign_transport(struct vsock_sock *vsk, struct vsock_sock *psk)
return 0; return 0;
/* transport->release() must be called with sock lock acquired. /* transport->release() must be called with sock lock acquired.
* This path can only be taken during vsock_stream_connect(), * This path can only be taken during vsock_connect(), where we
* where we have already held the sock lock. * have already held the sock lock. In the other cases, this
* In the other cases, this function is called on a new socket * function is called on a new socket which is not assigned to
* which is not assigned to any transport. * any transport.
*/ */
vsk->transport->release(vsk); vsk->transport->release(vsk);
vsock_deassign_transport(vsk); vsock_deassign_transport(vsk);
...@@ -658,9 +658,10 @@ static int __vsock_bind_connectible(struct vsock_sock *vsk, ...@@ -658,9 +658,10 @@ static int __vsock_bind_connectible(struct vsock_sock *vsk,
vsock_addr_init(&vsk->local_addr, new_addr.svm_cid, new_addr.svm_port); vsock_addr_init(&vsk->local_addr, new_addr.svm_cid, new_addr.svm_port);
/* Remove stream sockets from the unbound list and add them to the hash /* Remove connection oriented sockets from the unbound list and add them
* table for easy lookup by its address. The unbound list is simply an * to the hash table for easy lookup by its address. The unbound list
* extra entry at the end of the hash table, a trick used by AF_UNIX. * is simply an extra entry at the end of the hash table, a trick used
* by AF_UNIX.
*/ */
__vsock_remove_bound(vsk); __vsock_remove_bound(vsk);
__vsock_insert_bound(vsock_bound_sockets(&vsk->local_addr), vsk); __vsock_insert_bound(vsock_bound_sockets(&vsk->local_addr), vsk);
...@@ -962,10 +963,10 @@ static int vsock_shutdown(struct socket *sock, int mode) ...@@ -962,10 +963,10 @@ static int vsock_shutdown(struct socket *sock, int mode)
if ((mode & ~SHUTDOWN_MASK) || !mode) if ((mode & ~SHUTDOWN_MASK) || !mode)
return -EINVAL; return -EINVAL;
/* If this is a STREAM socket and it is not connected then bail out /* If this is a connection oriented socket and it is not connected then
* immediately. If it is a DGRAM socket then we must first kick the * bail out immediately. If it is a DGRAM socket then we must first
* socket so that it wakes up from any sleeping calls, for example * kick the socket so that it wakes up from any sleeping calls, for
* recv(), and then afterwards return the error. * example recv(), and then afterwards return the error.
*/ */
sk = sock->sk; sk = sock->sk;
...@@ -1737,7 +1738,9 @@ static int vsock_connectible_sendmsg(struct socket *sock, struct msghdr *msg, ...@@ -1737,7 +1738,9 @@ static int vsock_connectible_sendmsg(struct socket *sock, struct msghdr *msg,
transport = vsk->transport; transport = vsk->transport;
/* Callers should not provide a destination with stream sockets. */ /* Callers should not provide a destination with connection oriented
* sockets.
*/
if (msg->msg_namelen) { if (msg->msg_namelen) {
err = sk->sk_state == TCP_ESTABLISHED ? -EISCONN : -EOPNOTSUPP; err = sk->sk_state == TCP_ESTABLISHED ? -EISCONN : -EOPNOTSUPP;
goto out; goto out;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment