diff options
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; |