diff options
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r-- | net/sctp/socket.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index d049b2ce5cf2..e527267a0536 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -3752,10 +3752,9 @@ static int sctp_getsockopt_peer_addrs_old(struct sock *sk, int len, | |||
3752 | to = (void __user *)getaddrs.addrs; | 3752 | to = (void __user *)getaddrs.addrs; |
3753 | list_for_each(pos, &asoc->peer.transport_addr_list) { | 3753 | list_for_each(pos, &asoc->peer.transport_addr_list) { |
3754 | from = list_entry(pos, struct sctp_transport, transports); | 3754 | from = list_entry(pos, struct sctp_transport, transports); |
3755 | memcpy(&temp, &from->ipaddr_h, sizeof(temp)); | 3755 | memcpy(&temp, &from->ipaddr, sizeof(temp)); |
3756 | sctp_get_pf_specific(sk->sk_family)->addr_v4map(sp, &temp); | 3756 | sctp_get_pf_specific(sk->sk_family)->addr_v4map(sp, &temp); |
3757 | addrlen = sctp_get_af_specific(sk->sk_family)->sockaddr_len; | 3757 | addrlen = sctp_get_af_specific(sk->sk_family)->sockaddr_len; |
3758 | temp.v4.sin_port = htons(temp.v4.sin_port); | ||
3759 | if (copy_to_user(to, &temp, addrlen)) | 3758 | if (copy_to_user(to, &temp, addrlen)) |
3760 | return -EFAULT; | 3759 | return -EFAULT; |
3761 | to += addrlen ; | 3760 | to += addrlen ; |
@@ -3801,12 +3800,11 @@ static int sctp_getsockopt_peer_addrs(struct sock *sk, int len, | |||
3801 | 3800 | ||
3802 | list_for_each(pos, &asoc->peer.transport_addr_list) { | 3801 | list_for_each(pos, &asoc->peer.transport_addr_list) { |
3803 | from = list_entry(pos, struct sctp_transport, transports); | 3802 | from = list_entry(pos, struct sctp_transport, transports); |
3804 | memcpy(&temp, &from->ipaddr_h, sizeof(temp)); | 3803 | memcpy(&temp, &from->ipaddr, sizeof(temp)); |
3805 | sctp_get_pf_specific(sk->sk_family)->addr_v4map(sp, &temp); | 3804 | sctp_get_pf_specific(sk->sk_family)->addr_v4map(sp, &temp); |
3806 | addrlen = sctp_get_af_specific(sk->sk_family)->sockaddr_len; | 3805 | addrlen = sctp_get_af_specific(sk->sk_family)->sockaddr_len; |
3807 | if(space_left < addrlen) | 3806 | if(space_left < addrlen) |
3808 | return -ENOMEM; | 3807 | return -ENOMEM; |
3809 | temp.v4.sin_port = htons(temp.v4.sin_port); | ||
3810 | if (copy_to_user(to, &temp, addrlen)) | 3808 | if (copy_to_user(to, &temp, addrlen)) |
3811 | return -EFAULT; | 3809 | return -EFAULT; |
3812 | to += addrlen; | 3810 | to += addrlen; |