diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2006-09-27 14:57:54 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-09-27 14:57:54 -0400 |
commit | 2dc94310bd94d0906febea7d0f7c188da620c952 (patch) | |
tree | 6de4096f1887e2c00966177354b1c378e59bd632 /net/sctp/socket.c | |
parent | c06015148fa9a3cc452ec7121b8c3f59f4a7d6ac (diff) | |
parent | fb60cf4ab52f3520c2119aa42f7d4ed8e7594eb6 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/tmlind/linux-omap-upstream into devel
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r-- | net/sctp/socket.c | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index dab15949958e..79c3e072cf28 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -2081,13 +2081,13 @@ static int sctp_setsockopt_autoclose(struct sock *sk, char __user *optval, | |||
2081 | * SPP_SACKDELAY_ENABLE, setting both will have undefined | 2081 | * SPP_SACKDELAY_ENABLE, setting both will have undefined |
2082 | * results. | 2082 | * results. |
2083 | */ | 2083 | */ |
2084 | int sctp_apply_peer_addr_params(struct sctp_paddrparams *params, | 2084 | static int sctp_apply_peer_addr_params(struct sctp_paddrparams *params, |
2085 | struct sctp_transport *trans, | 2085 | struct sctp_transport *trans, |
2086 | struct sctp_association *asoc, | 2086 | struct sctp_association *asoc, |
2087 | struct sctp_sock *sp, | 2087 | struct sctp_sock *sp, |
2088 | int hb_change, | 2088 | int hb_change, |
2089 | int pmtud_change, | 2089 | int pmtud_change, |
2090 | int sackdelay_change) | 2090 | int sackdelay_change) |
2091 | { | 2091 | { |
2092 | int error; | 2092 | int error; |
2093 | 2093 | ||
@@ -2970,7 +2970,7 @@ SCTP_STATIC struct sock *sctp_accept(struct sock *sk, int flags, int *err) | |||
2970 | goto out; | 2970 | goto out; |
2971 | } | 2971 | } |
2972 | 2972 | ||
2973 | timeo = sock_rcvtimeo(sk, sk->sk_socket->file->f_flags & O_NONBLOCK); | 2973 | timeo = sock_rcvtimeo(sk, flags & O_NONBLOCK); |
2974 | 2974 | ||
2975 | error = sctp_wait_for_accept(sk, timeo); | 2975 | error = sctp_wait_for_accept(sk, timeo); |
2976 | if (error) | 2976 | if (error) |
@@ -3045,14 +3045,14 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk) | |||
3045 | sp->initmsg.sinit_num_ostreams = sctp_max_outstreams; | 3045 | sp->initmsg.sinit_num_ostreams = sctp_max_outstreams; |
3046 | sp->initmsg.sinit_max_instreams = sctp_max_instreams; | 3046 | sp->initmsg.sinit_max_instreams = sctp_max_instreams; |
3047 | sp->initmsg.sinit_max_attempts = sctp_max_retrans_init; | 3047 | sp->initmsg.sinit_max_attempts = sctp_max_retrans_init; |
3048 | sp->initmsg.sinit_max_init_timeo = jiffies_to_msecs(sctp_rto_max); | 3048 | sp->initmsg.sinit_max_init_timeo = sctp_rto_max; |
3049 | 3049 | ||
3050 | /* Initialize default RTO related parameters. These parameters can | 3050 | /* Initialize default RTO related parameters. These parameters can |
3051 | * be modified for with the SCTP_RTOINFO socket option. | 3051 | * be modified for with the SCTP_RTOINFO socket option. |
3052 | */ | 3052 | */ |
3053 | sp->rtoinfo.srto_initial = jiffies_to_msecs(sctp_rto_initial); | 3053 | sp->rtoinfo.srto_initial = sctp_rto_initial; |
3054 | sp->rtoinfo.srto_max = jiffies_to_msecs(sctp_rto_max); | 3054 | sp->rtoinfo.srto_max = sctp_rto_max; |
3055 | sp->rtoinfo.srto_min = jiffies_to_msecs(sctp_rto_min); | 3055 | sp->rtoinfo.srto_min = sctp_rto_min; |
3056 | 3056 | ||
3057 | /* Initialize default association related parameters. These parameters | 3057 | /* Initialize default association related parameters. These parameters |
3058 | * can be modified with the SCTP_ASSOCINFO socket option. | 3058 | * can be modified with the SCTP_ASSOCINFO socket option. |
@@ -3061,8 +3061,7 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk) | |||
3061 | sp->assocparams.sasoc_number_peer_destinations = 0; | 3061 | sp->assocparams.sasoc_number_peer_destinations = 0; |
3062 | sp->assocparams.sasoc_peer_rwnd = 0; | 3062 | sp->assocparams.sasoc_peer_rwnd = 0; |
3063 | sp->assocparams.sasoc_local_rwnd = 0; | 3063 | sp->assocparams.sasoc_local_rwnd = 0; |
3064 | sp->assocparams.sasoc_cookie_life = | 3064 | sp->assocparams.sasoc_cookie_life = sctp_valid_cookie_life; |
3065 | jiffies_to_msecs(sctp_valid_cookie_life); | ||
3066 | 3065 | ||
3067 | /* Initialize default event subscriptions. By default, all the | 3066 | /* Initialize default event subscriptions. By default, all the |
3068 | * options are off. | 3067 | * options are off. |
@@ -3072,10 +3071,10 @@ SCTP_STATIC int sctp_init_sock(struct sock *sk) | |||
3072 | /* Default Peer Address Parameters. These defaults can | 3071 | /* Default Peer Address Parameters. These defaults can |
3073 | * be modified via SCTP_PEER_ADDR_PARAMS | 3072 | * be modified via SCTP_PEER_ADDR_PARAMS |
3074 | */ | 3073 | */ |
3075 | sp->hbinterval = jiffies_to_msecs(sctp_hb_interval); | 3074 | sp->hbinterval = sctp_hb_interval; |
3076 | sp->pathmaxrxt = sctp_max_retrans_path; | 3075 | sp->pathmaxrxt = sctp_max_retrans_path; |
3077 | sp->pathmtu = 0; // allow default discovery | 3076 | sp->pathmtu = 0; // allow default discovery |
3078 | sp->sackdelay = jiffies_to_msecs(sctp_sack_timeout); | 3077 | sp->sackdelay = sctp_sack_timeout; |
3079 | sp->param_flags = SPP_HB_ENABLE | | 3078 | sp->param_flags = SPP_HB_ENABLE | |
3080 | SPP_PMTUD_ENABLE | | 3079 | SPP_PMTUD_ENABLE | |
3081 | SPP_SACKDELAY_ENABLE; | 3080 | SPP_SACKDELAY_ENABLE; |
@@ -4898,7 +4897,7 @@ SCTP_STATIC int sctp_stream_listen(struct sock *sk, int backlog) | |||
4898 | int sctp_inet_listen(struct socket *sock, int backlog) | 4897 | int sctp_inet_listen(struct socket *sock, int backlog) |
4899 | { | 4898 | { |
4900 | struct sock *sk = sock->sk; | 4899 | struct sock *sk = sock->sk; |
4901 | struct crypto_tfm *tfm=NULL; | 4900 | struct crypto_hash *tfm = NULL; |
4902 | int err = -EINVAL; | 4901 | int err = -EINVAL; |
4903 | 4902 | ||
4904 | if (unlikely(backlog < 0)) | 4903 | if (unlikely(backlog < 0)) |
@@ -4911,7 +4910,7 @@ int sctp_inet_listen(struct socket *sock, int backlog) | |||
4911 | 4910 | ||
4912 | /* Allocate HMAC for generating cookie. */ | 4911 | /* Allocate HMAC for generating cookie. */ |
4913 | if (sctp_hmac_alg) { | 4912 | if (sctp_hmac_alg) { |
4914 | tfm = sctp_crypto_alloc_tfm(sctp_hmac_alg, 0); | 4913 | tfm = crypto_alloc_hash(sctp_hmac_alg, 0, CRYPTO_ALG_ASYNC); |
4915 | if (!tfm) { | 4914 | if (!tfm) { |
4916 | err = -ENOSYS; | 4915 | err = -ENOSYS; |
4917 | goto out; | 4916 | goto out; |
@@ -4937,7 +4936,7 @@ out: | |||
4937 | sctp_release_sock(sk); | 4936 | sctp_release_sock(sk); |
4938 | return err; | 4937 | return err; |
4939 | cleanup: | 4938 | cleanup: |
4940 | sctp_crypto_free_tfm(tfm); | 4939 | crypto_free_hash(tfm); |
4941 | goto out; | 4940 | goto out; |
4942 | } | 4941 | } |
4943 | 4942 | ||
@@ -5619,6 +5618,8 @@ static void sctp_sock_migrate(struct sock *oldsk, struct sock *newsk, | |||
5619 | /* Copy the bind_addr list from the original endpoint to the new | 5618 | /* Copy the bind_addr list from the original endpoint to the new |
5620 | * endpoint so that we can handle restarts properly | 5619 | * endpoint so that we can handle restarts properly |
5621 | */ | 5620 | */ |
5621 | if (PF_INET6 == assoc->base.sk->sk_family) | ||
5622 | flags = SCTP_ADDR6_ALLOWED; | ||
5622 | if (assoc->peer.ipv4_address) | 5623 | if (assoc->peer.ipv4_address) |
5623 | flags |= SCTP_ADDR4_PEERSUPP; | 5624 | flags |= SCTP_ADDR4_PEERSUPP; |
5624 | if (assoc->peer.ipv6_address) | 5625 | if (assoc->peer.ipv6_address) |