summaryrefslogtreecommitdiff
path: root/net/sctp/socket.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2006-11-20 17:07:06 -0800
committerDavid S. Miller <davem@sunset.davemloft.net>2006-12-02 21:26:37 -0800
commitbe29681edfbad72167df735e243e8621840dca4f (patch)
treeefc92cc3520bfc222200d82f561ccb84c9f7c5d0 /net/sctp/socket.c
parent38a03145efcdbbcc60465fdffc0546208a52daf8 (diff)
[SCTP]: Switch sctp_assoc_lookup_paddr() to net-endian.
Callers updated. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r--net/sctp/socket.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index d42953efa355..ffdad8e842ac 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -1370,7 +1370,7 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
struct sctp_association *new_asoc=NULL, *asoc=NULL;
struct sctp_transport *transport, *chunk_tp;
struct sctp_chunk *chunk;
- union sctp_addr to;
+ union sctp_addr to, tmp;
struct sockaddr *msg_name = NULL;
struct sctp_sndrcvinfo default_sinfo = { 0 };
struct sctp_sndrcvinfo *sinfo;
@@ -1424,6 +1424,7 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
if (msg_namelen > sizeof(to))
msg_namelen = sizeof(to);
memcpy(&to, msg->msg_name, msg_namelen);
+ memcpy(&tmp, msg->msg_name, msg_namelen);
SCTP_DEBUG_PRINTK("Just memcpy'd. msg_name is "
"0x%x:%u.\n",
to.v4.sin_addr.s_addr, to.v4.sin_port);
@@ -1691,7 +1692,7 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
*/
if ((sctp_style(sk, TCP) && msg_name) ||
(sinfo_flags & SCTP_ADDR_OVER)) {
- chunk_tp = sctp_assoc_lookup_paddr(asoc, &to);
+ chunk_tp = sctp_assoc_lookup_paddr(asoc, &tmp);
if (!chunk_tp) {
err = -EINVAL;
goto out_free;