From: Vlad Yasevich Date: Sat, 1 May 2010 01:42:42 +0000 (-0400) Subject: sctp: Use correct address family in sctp_getsockopt_peer_addrs() X-Git-Tag: v2.6.35-rc1~473^2~287^2~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a5f4cea74f1397bb29d0bbdabeb05bd05a23a741;p=platform%2Fkernel%2Flinux-3.10.git sctp: Use correct address family in sctp_getsockopt_peer_addrs() The function should use the address family of the address when trying to determine the length of the structure. Signed-off-by: Vlad Yasevich --- diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 13d8229..1282a0e 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -4384,7 +4384,7 @@ static int sctp_getsockopt_peer_addrs(struct sock *sk, int len, transports) { memcpy(&temp, &from->ipaddr, sizeof(temp)); sctp_get_pf_specific(sk->sk_family)->addr_v4map(sp, &temp); - addrlen = sctp_get_af_specific(sk->sk_family)->sockaddr_len; + addrlen = sctp_get_af_specific(temp.sa.sa_family)->sockaddr_len; if (space_left < addrlen) return -ENOMEM; if (copy_to_user(to, &temp, addrlen))