diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2006-11-20 20:10:20 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-12-03 00:26:46 -0500 |
commit | 4bdf4b5fe22c26750c39fdd2939a5f33df0cc341 (patch) | |
tree | 36daeb8ec4543df2e02e51a11d13852d4eb1fc3c /net/sctp/socket.c | |
parent | b488c7dd58f61e07b54e5d286c7b45c43dd52f1a (diff) |
[SCTP]: Switch sctp_assoc_add_peer() to net-endian.
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.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index f00b03845247..3dd7ada8026c 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -969,7 +969,7 @@ static int __sctp_connect(struct sock* sk, | |||
969 | int err = 0; | 969 | int err = 0; |
970 | int addrcnt = 0; | 970 | int addrcnt = 0; |
971 | int walk_size = 0; | 971 | int walk_size = 0; |
972 | struct sockaddr *sa_addr; | 972 | union sctp_addr *sa_addr; |
973 | void *addr_buf; | 973 | void *addr_buf; |
974 | 974 | ||
975 | sp = sctp_sk(sk); | 975 | sp = sctp_sk(sk); |
@@ -989,8 +989,8 @@ static int __sctp_connect(struct sock* sk, | |||
989 | /* Walk through the addrs buffer and count the number of addresses. */ | 989 | /* Walk through the addrs buffer and count the number of addresses. */ |
990 | addr_buf = kaddrs; | 990 | addr_buf = kaddrs; |
991 | while (walk_size < addrs_size) { | 991 | while (walk_size < addrs_size) { |
992 | sa_addr = (struct sockaddr *)addr_buf; | 992 | sa_addr = (union sctp_addr *)addr_buf; |
993 | af = sctp_get_af_specific(sa_addr->sa_family); | 993 | af = sctp_get_af_specific(sa_addr->sa.sa_family); |
994 | 994 | ||
995 | /* If the address family is not supported or if this address | 995 | /* If the address family is not supported or if this address |
996 | * causes the address buffer to overflow return EINVAL. | 996 | * causes the address buffer to overflow return EINVAL. |
@@ -1000,8 +1000,7 @@ static int __sctp_connect(struct sock* sk, | |||
1000 | goto out_free; | 1000 | goto out_free; |
1001 | } | 1001 | } |
1002 | 1002 | ||
1003 | err = sctp_verify_addr(sk, (union sctp_addr *)sa_addr, | 1003 | err = sctp_verify_addr(sk, sa_addr, af->sockaddr_len); |
1004 | af->sockaddr_len); | ||
1005 | if (err) | 1004 | if (err) |
1006 | goto out_free; | 1005 | goto out_free; |
1007 | 1006 | ||
@@ -1064,7 +1063,7 @@ static int __sctp_connect(struct sock* sk, | |||
1064 | } | 1063 | } |
1065 | 1064 | ||
1066 | /* Prime the peer's transport structures. */ | 1065 | /* Prime the peer's transport structures. */ |
1067 | transport = sctp_assoc_add_peer(asoc, &to, GFP_KERNEL, | 1066 | transport = sctp_assoc_add_peer(asoc, sa_addr, GFP_KERNEL, |
1068 | SCTP_UNKNOWN); | 1067 | SCTP_UNKNOWN); |
1069 | if (!transport) { | 1068 | if (!transport) { |
1070 | err = -ENOMEM; | 1069 | err = -ENOMEM; |
@@ -1618,7 +1617,7 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
1618 | } | 1617 | } |
1619 | 1618 | ||
1620 | /* Prime the peer's transport structures. */ | 1619 | /* Prime the peer's transport structures. */ |
1621 | transport = sctp_assoc_add_peer(asoc, &to, GFP_KERNEL, SCTP_UNKNOWN); | 1620 | transport = sctp_assoc_add_peer(asoc, &tmp, GFP_KERNEL, SCTP_UNKNOWN); |
1622 | if (!transport) { | 1621 | if (!transport) { |
1623 | err = -ENOMEM; | 1622 | err = -ENOMEM; |
1624 | goto out_free; | 1623 | goto out_free; |