diff options
author | Vlad Yasevich <vladislav.yasevich@hp.com> | 2008-02-27 16:04:52 -0500 |
---|---|---|
committer | Vlad Yasevich <vladislav.yasevich@hp.com> | 2008-02-28 16:45:04 -0500 |
commit | 7e8616d8e7731b026019d9af7cc9914b8bb42bc7 (patch) | |
tree | ab2e83ac38625159f53eace7c99e2017df523198 /net/sctp | |
parent | b40db6846847e82daf175641987df29324c425fa (diff) |
[SCTP]: Update AUTH structures to match declarations in draft-16.
The new SCTP socket api (draft 16) updates the AUTH API structures.
We never exported these since we knew they would change.
Update the rest to match the draft.
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Diffstat (limited to 'net/sctp')
-rw-r--r-- | net/sctp/auth.c | 4 | ||||
-rw-r--r-- | net/sctp/socket.c | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/net/sctp/auth.c b/net/sctp/auth.c index 8bb79f281774..675a5c3e68a6 100644 --- a/net/sctp/auth.c +++ b/net/sctp/auth.c | |||
@@ -838,11 +838,11 @@ int sctp_auth_set_key(struct sctp_endpoint *ep, | |||
838 | } | 838 | } |
839 | 839 | ||
840 | /* Create a new key data based on the info passed in */ | 840 | /* Create a new key data based on the info passed in */ |
841 | key = sctp_auth_create_key(auth_key->sca_keylen, GFP_KERNEL); | 841 | key = sctp_auth_create_key(auth_key->sca_keylength, GFP_KERNEL); |
842 | if (!key) | 842 | if (!key) |
843 | goto nomem; | 843 | goto nomem; |
844 | 844 | ||
845 | memcpy(key->data, &auth_key->sca_key[0], auth_key->sca_keylen); | 845 | memcpy(key->data, &auth_key->sca_key[0], auth_key->sca_keylength); |
846 | 846 | ||
847 | /* If we are replacing, remove the old keys data from the | 847 | /* If we are replacing, remove the old keys data from the |
848 | * key id. If we are adding new key id, add it to the | 848 | * key id. If we are adding new key id, add it to the |
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 848df21dc6c1..939892691a26 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -1964,7 +1964,7 @@ static int sctp_setsockopt_disable_fragments(struct sock *sk, | |||
1964 | static int sctp_setsockopt_events(struct sock *sk, char __user *optval, | 1964 | static int sctp_setsockopt_events(struct sock *sk, char __user *optval, |
1965 | int optlen) | 1965 | int optlen) |
1966 | { | 1966 | { |
1967 | if (optlen != sizeof(struct sctp_event_subscribe)) | 1967 | if (optlen > sizeof(struct sctp_event_subscribe)) |
1968 | return -EINVAL; | 1968 | return -EINVAL; |
1969 | if (copy_from_user(&sctp_sk(sk)->subscribe, optval, optlen)) | 1969 | if (copy_from_user(&sctp_sk(sk)->subscribe, optval, optlen)) |
1970 | return -EFAULT; | 1970 | return -EFAULT; |
@@ -5094,6 +5094,8 @@ static int sctp_getsockopt_peer_auth_chunks(struct sock *sk, int len, | |||
5094 | len = num_chunks; | 5094 | len = num_chunks; |
5095 | if (put_user(len, optlen)) | 5095 | if (put_user(len, optlen)) |
5096 | return -EFAULT; | 5096 | return -EFAULT; |
5097 | if (put_user(num_chunks, &p->gauth_number_of_chunks)) | ||
5098 | return -EFAULT; | ||
5097 | if (copy_to_user(to, ch->chunks, len)) | 5099 | if (copy_to_user(to, ch->chunks, len)) |
5098 | return -EFAULT; | 5100 | return -EFAULT; |
5099 | 5101 | ||
@@ -5133,6 +5135,8 @@ static int sctp_getsockopt_local_auth_chunks(struct sock *sk, int len, | |||
5133 | len = num_chunks; | 5135 | len = num_chunks; |
5134 | if (put_user(len, optlen)) | 5136 | if (put_user(len, optlen)) |
5135 | return -EFAULT; | 5137 | return -EFAULT; |
5138 | if (put_user(num_chunks, &p->gauth_number_of_chunks)) | ||
5139 | return -EFAULT; | ||
5136 | if (copy_to_user(to, ch->chunks, len)) | 5140 | if (copy_to_user(to, ch->chunks, len)) |
5137 | return -EFAULT; | 5141 | return -EFAULT; |
5138 | 5142 | ||