Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 10741
b: refs/heads/master
c: a1ab358
h: refs/heads/master
i:
  10739: 3922525
v: v3
  • Loading branch information
Ivan Skytte Jorgensen authored and Sridhar Samudrala committed Oct 28, 2005
1 parent 4c080b9 commit 29c1ebd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: eaa5c54dbec70e2a93d6ed412bb589bbf9c90a17
refs/heads/master: a1ab3582699def352dab1355adcadd3d47f79f0f
20 changes: 9 additions & 11 deletions trunk/net/sctp/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -2384,14 +2384,14 @@ static int sctp_setsockopt_peer_primary_addr(struct sock *sk, char __user *optva
static int sctp_setsockopt_adaption_layer(struct sock *sk, char __user *optval,
int optlen)
{
__u32 val;
struct sctp_setadaption adaption;

if (optlen < sizeof(__u32))
if (optlen != sizeof(struct sctp_setadaption))
return -EINVAL;
if (copy_from_user(&val, optval, sizeof(__u32)))
if (copy_from_user(&adaption, optval, optlen))
return -EFAULT;

sctp_sk(sk)->adaption_ind = val;
sctp_sk(sk)->adaption_ind = adaption.ssb_adaption_ind;

return 0;
}
Expand Down Expand Up @@ -3672,17 +3672,15 @@ static int sctp_getsockopt_primary_addr(struct sock *sk, int len,
static int sctp_getsockopt_adaption_layer(struct sock *sk, int len,
char __user *optval, int __user *optlen)
{
__u32 val;
struct sctp_setadaption adaption;

if (len < sizeof(__u32))
if (len != sizeof(struct sctp_setadaption))
return -EINVAL;

len = sizeof(__u32);
val = sctp_sk(sk)->adaption_ind;
if (put_user(len, optlen))
return -EFAULT;
if (copy_to_user(optval, &val, len))
adaption.ssb_adaption_ind = sctp_sk(sk)->adaption_ind;
if (copy_to_user(optval, &adaption, len))
return -EFAULT;

return 0;
}

Expand Down

0 comments on commit 29c1ebd

Please sign in to comment.