diff options
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r-- | net/sctp/socket.c | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 971890dbfea0..89af37a6c871 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -1361,6 +1361,7 @@ SCTP_STATIC void sctp_close(struct sock *sk, long timeout) | |||
1361 | 1361 | ||
1362 | sctp_lock_sock(sk); | 1362 | sctp_lock_sock(sk); |
1363 | sk->sk_shutdown = SHUTDOWN_MASK; | 1363 | sk->sk_shutdown = SHUTDOWN_MASK; |
1364 | sk->sk_state = SCTP_SS_CLOSING; | ||
1364 | 1365 | ||
1365 | ep = sctp_sk(sk)->ep; | 1366 | ep = sctp_sk(sk)->ep; |
1366 | 1367 | ||
@@ -1813,20 +1814,22 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
1813 | sctp_set_owner_w(chunk); | 1814 | sctp_set_owner_w(chunk); |
1814 | 1815 | ||
1815 | chunk->transport = chunk_tp; | 1816 | chunk->transport = chunk_tp; |
1816 | |||
1817 | /* Send it to the lower layers. Note: all chunks | ||
1818 | * must either fail or succeed. The lower layer | ||
1819 | * works that way today. Keep it that way or this | ||
1820 | * breaks. | ||
1821 | */ | ||
1822 | err = sctp_primitive_SEND(asoc, chunk); | ||
1823 | /* Did the lower layer accept the chunk? */ | ||
1824 | if (err) | ||
1825 | sctp_chunk_free(chunk); | ||
1826 | SCTP_DEBUG_PRINTK("We sent primitively.\n"); | ||
1827 | } | 1817 | } |
1828 | 1818 | ||
1829 | sctp_datamsg_put(datamsg); | 1819 | /* Send it to the lower layers. Note: all chunks |
1820 | * must either fail or succeed. The lower layer | ||
1821 | * works that way today. Keep it that way or this | ||
1822 | * breaks. | ||
1823 | */ | ||
1824 | err = sctp_primitive_SEND(asoc, datamsg); | ||
1825 | /* Did the lower layer accept the chunk? */ | ||
1826 | if (err) | ||
1827 | sctp_datamsg_free(datamsg); | ||
1828 | else | ||
1829 | sctp_datamsg_put(datamsg); | ||
1830 | |||
1831 | SCTP_DEBUG_PRINTK("We sent primitively.\n"); | ||
1832 | |||
1830 | if (err) | 1833 | if (err) |
1831 | goto out_free; | 1834 | goto out_free; |
1832 | else | 1835 | else |
@@ -2240,7 +2243,7 @@ static int sctp_apply_peer_addr_params(struct sctp_paddrparams *params, | |||
2240 | sctp_assoc_sync_pmtu(asoc); | 2243 | sctp_assoc_sync_pmtu(asoc); |
2241 | } else if (asoc) { | 2244 | } else if (asoc) { |
2242 | asoc->pathmtu = params->spp_pathmtu; | 2245 | asoc->pathmtu = params->spp_pathmtu; |
2243 | sctp_frag_point(sp, params->spp_pathmtu); | 2246 | sctp_frag_point(asoc, params->spp_pathmtu); |
2244 | } else { | 2247 | } else { |
2245 | sp->pathmtu = params->spp_pathmtu; | 2248 | sp->pathmtu = params->spp_pathmtu; |
2246 | } | 2249 | } |
@@ -2877,15 +2880,10 @@ static int sctp_setsockopt_maxseg(struct sock *sk, char __user *optval, int optl | |||
2877 | val -= sizeof(struct sctphdr) + | 2880 | val -= sizeof(struct sctphdr) + |
2878 | sizeof(struct sctp_data_chunk); | 2881 | sizeof(struct sctp_data_chunk); |
2879 | } | 2882 | } |
2880 | 2883 | asoc->user_frag = val; | |
2881 | asoc->frag_point = val; | 2884 | asoc->frag_point = sctp_frag_point(asoc, asoc->pathmtu); |
2882 | } else { | 2885 | } else { |
2883 | sp->user_frag = val; | 2886 | sp->user_frag = val; |
2884 | |||
2885 | /* Update the frag_point of the existing associations. */ | ||
2886 | list_for_each_entry(asoc, &(sp->ep->asocs), asocs) { | ||
2887 | asoc->frag_point = sctp_frag_point(sp, asoc->pathmtu); | ||
2888 | } | ||
2889 | } | 2887 | } |
2890 | 2888 | ||
2891 | return 0; | 2889 | return 0; |