summaryrefslogtreecommitdiffstats
path: root/net/sctp
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/associola.c3
-rw-r--r--net/sctp/input.c1
-rw-r--r--net/sctp/output.c6
-rw-r--r--net/sctp/socket.c17
4 files changed, 18 insertions, 9 deletions
diff --git a/net/sctp/associola.c b/net/sctp/associola.c
index 297d9cf960b9..a827a1f562bf 100644
--- a/net/sctp/associola.c
+++ b/net/sctp/associola.c
@@ -1450,7 +1450,8 @@ void sctp_assoc_sync_pmtu(struct sctp_association *asoc)
1450 /* Get the lowest pmtu of all the transports. */ 1450 /* Get the lowest pmtu of all the transports. */
1451 list_for_each_entry(t, &asoc->peer.transport_addr_list, transports) { 1451 list_for_each_entry(t, &asoc->peer.transport_addr_list, transports) {
1452 if (t->pmtu_pending && t->dst) { 1452 if (t->pmtu_pending && t->dst) {
1453 sctp_transport_update_pmtu(t, sctp_dst_mtu(t->dst)); 1453 sctp_transport_update_pmtu(t,
1454 atomic_read(&t->mtu_info));
1454 t->pmtu_pending = 0; 1455 t->pmtu_pending = 0;
1455 } 1456 }
1456 if (!pmtu || (t->pathmtu < pmtu)) 1457 if (!pmtu || (t->pathmtu < pmtu))
diff --git a/net/sctp/input.c b/net/sctp/input.c
index 9bbc5f92c941..5c36a99882ed 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -395,6 +395,7 @@ void sctp_icmp_frag_needed(struct sock *sk, struct sctp_association *asoc,
395 return; 395 return;
396 396
397 if (sock_owned_by_user(sk)) { 397 if (sock_owned_by_user(sk)) {
398 atomic_set(&t->mtu_info, pmtu);
398 asoc->pmtu_pending = 1; 399 asoc->pmtu_pending = 1;
399 t->pmtu_pending = 1; 400 t->pmtu_pending = 1;
400 return; 401 return;
diff --git a/net/sctp/output.c b/net/sctp/output.c
index 7f849b01ec8e..67939ad99c01 100644
--- a/net/sctp/output.c
+++ b/net/sctp/output.c
@@ -120,6 +120,12 @@ void sctp_packet_config(struct sctp_packet *packet, __u32 vtag,
120 sctp_assoc_sync_pmtu(asoc); 120 sctp_assoc_sync_pmtu(asoc);
121 } 121 }
122 122
123 if (asoc->pmtu_pending) {
124 if (asoc->param_flags & SPP_PMTUD_ENABLE)
125 sctp_assoc_sync_pmtu(asoc);
126 asoc->pmtu_pending = 0;
127 }
128
123 /* If there a is a prepend chunk stick it on the list before 129 /* If there a is a prepend chunk stick it on the list before
124 * any other chunks get appended. 130 * any other chunks get appended.
125 */ 131 */
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 111ebd89f0ab..fc0386e8ff23 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -253,11 +253,10 @@ struct sctp_association *sctp_id2assoc(struct sock *sk, sctp_assoc_t id)
253 253
254 spin_lock_bh(&sctp_assocs_id_lock); 254 spin_lock_bh(&sctp_assocs_id_lock);
255 asoc = (struct sctp_association *)idr_find(&sctp_assocs_id, (int)id); 255 asoc = (struct sctp_association *)idr_find(&sctp_assocs_id, (int)id);
256 if (asoc && (asoc->base.sk != sk || asoc->base.dead))
257 asoc = NULL;
256 spin_unlock_bh(&sctp_assocs_id_lock); 258 spin_unlock_bh(&sctp_assocs_id_lock);
257 259
258 if (!asoc || (asoc->base.sk != sk) || asoc->base.dead)
259 return NULL;
260
261 return asoc; 260 return asoc;
262} 261}
263 262
@@ -1928,8 +1927,10 @@ static int sctp_sendmsg_to_asoc(struct sctp_association *asoc,
1928 if (sp->strm_interleave) { 1927 if (sp->strm_interleave) {
1929 timeo = sock_sndtimeo(sk, 0); 1928 timeo = sock_sndtimeo(sk, 0);
1930 err = sctp_wait_for_connect(asoc, &timeo); 1929 err = sctp_wait_for_connect(asoc, &timeo);
1931 if (err) 1930 if (err) {
1931 err = -ESRCH;
1932 goto err; 1932 goto err;
1933 }
1933 } else { 1934 } else {
1934 wait_connect = true; 1935 wait_connect = true;
1935 } 1936 }
@@ -7082,14 +7083,14 @@ static int sctp_getsockopt_pr_assocstatus(struct sock *sk, int len,
7082 } 7083 }
7083 7084
7084 policy = params.sprstat_policy; 7085 policy = params.sprstat_policy;
7085 if (policy & ~SCTP_PR_SCTP_MASK) 7086 if (!policy || (policy & ~(SCTP_PR_SCTP_MASK | SCTP_PR_SCTP_ALL)))
7086 goto out; 7087 goto out;
7087 7088
7088 asoc = sctp_id2assoc(sk, params.sprstat_assoc_id); 7089 asoc = sctp_id2assoc(sk, params.sprstat_assoc_id);
7089 if (!asoc) 7090 if (!asoc)
7090 goto out; 7091 goto out;
7091 7092
7092 if (policy == SCTP_PR_SCTP_NONE) { 7093 if (policy & SCTP_PR_SCTP_ALL) {
7093 params.sprstat_abandoned_unsent = 0; 7094 params.sprstat_abandoned_unsent = 0;
7094 params.sprstat_abandoned_sent = 0; 7095 params.sprstat_abandoned_sent = 0;
7095 for (policy = 0; policy <= SCTP_PR_INDEX(MAX); policy++) { 7096 for (policy = 0; policy <= SCTP_PR_INDEX(MAX); policy++) {
@@ -7141,7 +7142,7 @@ static int sctp_getsockopt_pr_streamstatus(struct sock *sk, int len,
7141 } 7142 }
7142 7143
7143 policy = params.sprstat_policy; 7144 policy = params.sprstat_policy;
7144 if (policy & ~SCTP_PR_SCTP_MASK) 7145 if (!policy || (policy & ~(SCTP_PR_SCTP_MASK | SCTP_PR_SCTP_ALL)))
7145 goto out; 7146 goto out;
7146 7147
7147 asoc = sctp_id2assoc(sk, params.sprstat_assoc_id); 7148 asoc = sctp_id2assoc(sk, params.sprstat_assoc_id);
@@ -7157,7 +7158,7 @@ static int sctp_getsockopt_pr_streamstatus(struct sock *sk, int len,
7157 goto out; 7158 goto out;
7158 } 7159 }
7159 7160
7160 if (policy == SCTP_PR_SCTP_NONE) { 7161 if (policy == SCTP_PR_SCTP_ALL) {
7161 params.sprstat_abandoned_unsent = 0; 7162 params.sprstat_abandoned_unsent = 0;
7162 params.sprstat_abandoned_sent = 0; 7163 params.sprstat_abandoned_sent = 0;
7163 for (policy = 0; policy <= SCTP_PR_INDEX(MAX); policy++) { 7164 for (policy = 0; policy <= SCTP_PR_INDEX(MAX); policy++) {