Commit 4e30cacd authored by Sridhar Samudrala's avatar Sridhar Samudrala

[SCTP] PPC64 port: Don't overload the optval arg of ADDRS_NUM socket

options with different types for input and output. Instead use it only
as an input arg and return the no. of addresses in the return value.
parent abe68253
...@@ -2582,10 +2582,8 @@ static int sctp_getsockopt_peer_addrs_num(struct sock *sk, int len, ...@@ -2582,10 +2582,8 @@ static int sctp_getsockopt_peer_addrs_num(struct sock *sk, int len,
list_for_each(pos, &asoc->peer.transport_addr_list) { list_for_each(pos, &asoc->peer.transport_addr_list) {
cnt ++; cnt ++;
} }
if (copy_to_user(optval, &cnt, sizeof(int)))
return -EFAULT;
return 0; return cnt;
} }
static int sctp_getsockopt_peer_addrs(struct sock *sk, int len, static int sctp_getsockopt_peer_addrs(struct sock *sk, int len,
...@@ -2666,10 +2664,8 @@ static int sctp_getsockopt_local_addrs_num(struct sock *sk, int len, ...@@ -2666,10 +2664,8 @@ static int sctp_getsockopt_local_addrs_num(struct sock *sk, int len,
list_for_each(pos, &bp->address_list) { list_for_each(pos, &bp->address_list) {
cnt ++; cnt ++;
} }
if (copy_to_user(optval, &cnt, sizeof(int)))
return -EFAULT;
return 0; return cnt;
} }
static int sctp_getsockopt_local_addrs(struct sock *sk, int len, static int sctp_getsockopt_local_addrs(struct sock *sk, int len,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment