diff options
Diffstat (limited to 'net/sctp/outqueue.c')
-rw-r--r-- | net/sctp/outqueue.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c index 23e5e97aa617..229690f02a1d 100644 --- a/net/sctp/outqueue.c +++ b/net/sctp/outqueue.c | |||
@@ -191,8 +191,8 @@ static inline int sctp_cacc_skip(struct sctp_transport *primary, | |||
191 | __u32 tsn) | 191 | __u32 tsn) |
192 | { | 192 | { |
193 | if (primary->cacc.changeover_active && | 193 | if (primary->cacc.changeover_active && |
194 | (sctp_cacc_skip_3_1(primary, transport, count_of_newacks) | 194 | (sctp_cacc_skip_3_1(primary, transport, count_of_newacks) || |
195 | || sctp_cacc_skip_3_2(primary, tsn))) | 195 | sctp_cacc_skip_3_2(primary, tsn))) |
196 | return 1; | 196 | return 1; |
197 | return 0; | 197 | return 0; |
198 | } | 198 | } |
@@ -921,6 +921,14 @@ static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout) | |||
921 | goto sctp_flush_out; | 921 | goto sctp_flush_out; |
922 | } | 922 | } |
923 | 923 | ||
924 | /* Apply Max.Burst limitation to the current transport in | ||
925 | * case it will be used for new data. We are going to | ||
926 | * rest it before we return, but we want to apply the limit | ||
927 | * to the currently queued data. | ||
928 | */ | ||
929 | if (transport) | ||
930 | sctp_transport_burst_limited(transport); | ||
931 | |||
924 | /* Finally, transmit new packets. */ | 932 | /* Finally, transmit new packets. */ |
925 | while ((chunk = sctp_outq_dequeue_data(q)) != NULL) { | 933 | while ((chunk = sctp_outq_dequeue_data(q)) != NULL) { |
926 | /* RFC 2960 6.5 Every DATA chunk MUST carry a valid | 934 | /* RFC 2960 6.5 Every DATA chunk MUST carry a valid |
@@ -966,6 +974,10 @@ static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout) | |||
966 | packet = &transport->packet; | 974 | packet = &transport->packet; |
967 | sctp_packet_config(packet, vtag, | 975 | sctp_packet_config(packet, vtag, |
968 | asoc->peer.ecn_capable); | 976 | asoc->peer.ecn_capable); |
977 | /* We've switched transports, so apply the | ||
978 | * Burst limit to the new transport. | ||
979 | */ | ||
980 | sctp_transport_burst_limited(transport); | ||
969 | } | 981 | } |
970 | 982 | ||
971 | SCTP_DEBUG_PRINTK("sctp_outq_flush(%p, %p[%s]), ", | 983 | SCTP_DEBUG_PRINTK("sctp_outq_flush(%p, %p[%s]), ", |
@@ -1001,6 +1013,13 @@ static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout) | |||
1001 | break; | 1013 | break; |
1002 | 1014 | ||
1003 | case SCTP_XMIT_OK: | 1015 | case SCTP_XMIT_OK: |
1016 | /* The sender is in the SHUTDOWN-PENDING state, | ||
1017 | * The sender MAY set the I-bit in the DATA | ||
1018 | * chunk header. | ||
1019 | */ | ||
1020 | if (asoc->state == SCTP_STATE_SHUTDOWN_PENDING) | ||
1021 | chunk->chunk_hdr->flags |= SCTP_DATA_SACK_IMM; | ||
1022 | |||
1004 | break; | 1023 | break; |
1005 | 1024 | ||
1006 | default: | 1025 | default: |
@@ -1053,6 +1072,9 @@ sctp_flush_out: | |||
1053 | packet = &t->packet; | 1072 | packet = &t->packet; |
1054 | if (!sctp_packet_empty(packet)) | 1073 | if (!sctp_packet_empty(packet)) |
1055 | error = sctp_packet_transmit(packet); | 1074 | error = sctp_packet_transmit(packet); |
1075 | |||
1076 | /* Clear the burst limited state, if any */ | ||
1077 | sctp_transport_burst_reset(t); | ||
1056 | } | 1078 | } |
1057 | 1079 | ||
1058 | return error; | 1080 | return error; |