RxRPC: fix rxrpc_recvmsg()'s returning of msg_name
authorDavid Howells <dhowells@redhat.com>
Thu, 6 Mar 2008 02:53:55 +0000 (18:53 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 6 Mar 2008 02:53:55 +0000 (18:53 -0800)
Fix rxrpc_recvmsg() to return msg_name correctly.  We shouldn't
overwrite the *msg struct, but should rather write into msg->msg_name
(there's a '&' unary operator that shouldn't be there).

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/rxrpc/ar-recvmsg.c

index f19121d4795b25cbb687459741e318ce76091989..a39bf97f8830703cf1a6c5e23367727532e26efb 100644 (file)
@@ -143,7 +143,8 @@ int rxrpc_recvmsg(struct kiocb *iocb, struct socket *sock,
                /* copy the peer address and timestamp */
                if (!continue_call) {
                        if (msg->msg_name && msg->msg_namelen > 0)
-                               memcpy(&msg->msg_name, &call->conn->trans->peer->srx,
+                               memcpy(msg->msg_name,
+                                      &call->conn->trans->peer->srx,
                                       sizeof(call->conn->trans->peer->srx));
                        sock_recv_timestamp(msg, &rx->sk, skb);
                }