aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/outqueue.c
diff options
context:
space:
mode:
authorXin Long <lucien.xin@gmail.com>2016-09-28 14:37:28 -0400
committerDavid S. Miller <davem@davemloft.net>2016-09-30 02:07:05 -0400
commitbe4947bf46cb0e7a7d089e03c61bab35f1e695ce (patch)
tree859152992bd65e3da93767dbda6fbdf7e011e69c /net/sctp/outqueue.c
parent0605483f6ace1f6b63e397c819a115ddcd13af0d (diff)
sctp: change to check peer prsctp_capable when using prsctp polices
Now before using prsctp polices, sctp uses asoc->prsctp_enable to check if prsctp is enabled. However asoc->prsctp_enable is set only means local host support prsctp, sctp should not abandon packet if peer host doesn't enable prsctp. So this patch is to use asoc->peer.prsctp_capable to check if prsctp is enabled on both side, instead of asoc->prsctp_enable, as asoc's peer.prsctp_capable is set only when local and peer both enable prsctp. Fixes: a6c2f792873a ("sctp: implement prsctp TTL policy") Signed-off-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/outqueue.c')
-rw-r--r--net/sctp/outqueue.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/sctp/outqueue.c b/net/sctp/outqueue.c
index e084f35d40d2..107233da5cc9 100644
--- a/net/sctp/outqueue.c
+++ b/net/sctp/outqueue.c
@@ -326,7 +326,7 @@ int sctp_outq_tail(struct sctp_outq *q, struct sctp_chunk *chunk, gfp_t gfp)
326 326
327 sctp_chunk_hold(chunk); 327 sctp_chunk_hold(chunk);
328 sctp_outq_tail_data(q, chunk); 328 sctp_outq_tail_data(q, chunk);
329 if (chunk->asoc->prsctp_enable && 329 if (chunk->asoc->peer.prsctp_capable &&
330 SCTP_PR_PRIO_ENABLED(chunk->sinfo.sinfo_flags)) 330 SCTP_PR_PRIO_ENABLED(chunk->sinfo.sinfo_flags))
331 chunk->asoc->sent_cnt_removable++; 331 chunk->asoc->sent_cnt_removable++;
332 if (chunk->chunk_hdr->flags & SCTP_DATA_UNORDERED) 332 if (chunk->chunk_hdr->flags & SCTP_DATA_UNORDERED)
@@ -442,7 +442,7 @@ void sctp_prsctp_prune(struct sctp_association *asoc,
442{ 442{
443 struct sctp_transport *transport; 443 struct sctp_transport *transport;
444 444
445 if (!asoc->prsctp_enable || !asoc->sent_cnt_removable) 445 if (!asoc->peer.prsctp_capable || !asoc->sent_cnt_removable)
446 return; 446 return;
447 447
448 msg_len = sctp_prsctp_prune_sent(asoc, sinfo, 448 msg_len = sctp_prsctp_prune_sent(asoc, sinfo,
@@ -1055,7 +1055,7 @@ static int sctp_outq_flush(struct sctp_outq *q, int rtx_timeout, gfp_t gfp)
1055 1055
1056 /* Mark as failed send. */ 1056 /* Mark as failed send. */
1057 sctp_chunk_fail(chunk, SCTP_ERROR_INV_STRM); 1057 sctp_chunk_fail(chunk, SCTP_ERROR_INV_STRM);
1058 if (asoc->prsctp_enable && 1058 if (asoc->peer.prsctp_capable &&
1059 SCTP_PR_PRIO_ENABLED(chunk->sinfo.sinfo_flags)) 1059 SCTP_PR_PRIO_ENABLED(chunk->sinfo.sinfo_flags))
1060 asoc->sent_cnt_removable--; 1060 asoc->sent_cnt_removable--;
1061 sctp_chunk_free(chunk); 1061 sctp_chunk_free(chunk);
@@ -1347,7 +1347,7 @@ int sctp_outq_sack(struct sctp_outq *q, struct sctp_chunk *chunk)
1347 tsn = ntohl(tchunk->subh.data_hdr->tsn); 1347 tsn = ntohl(tchunk->subh.data_hdr->tsn);
1348 if (TSN_lte(tsn, ctsn)) { 1348 if (TSN_lte(tsn, ctsn)) {
1349 list_del_init(&tchunk->transmitted_list); 1349 list_del_init(&tchunk->transmitted_list);
1350 if (asoc->prsctp_enable && 1350 if (asoc->peer.prsctp_capable &&
1351 SCTP_PR_PRIO_ENABLED(chunk->sinfo.sinfo_flags)) 1351 SCTP_PR_PRIO_ENABLED(chunk->sinfo.sinfo_flags))
1352 asoc->sent_cnt_removable--; 1352 asoc->sent_cnt_removable--;
1353 sctp_chunk_free(tchunk); 1353 sctp_chunk_free(tchunk);