diff options
author | Xin Long <lucien.xin@gmail.com> | 2016-07-09 14:47:44 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-07-11 23:25:39 +0300 |
commit | 01aadb3af6e1b10970c1f7e510b5097c8f725d64 (patch) | |
tree | 48a0b5f81a01756090b6ecfe815f777be10f2041 /net/sctp/sm_make_chunk.c | |
parent | a6c2f792873aff332a4689717c3cd6104f46684c (diff) | |
download | linux-01aadb3af6e1b10970c1f7e510b5097c8f725d64.tar.xz |
sctp: implement prsctp RTX policy
prsctp RTX policy is a policy to abandon chunks when they are
retransmitted beyond the max count.
This patch uses sent_count to count how many times one chunk has
been sent, and prsctp_param is the max rtx count, which is from
sinfo->sinfo_timetolive in sctp_set_prsctp_policy(). So similar
to TTL policy, if RTX policy is enabled, msg->expire_at won't
work.
Then in sctp_chunk_abandoned, this patch checks if chunk->sent_count
is bigger than chunk->prsctp_param to abandon this chunk.
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/sm_make_chunk.c')
-rw-r--r-- | net/sctp/sm_make_chunk.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index 2c431eef3a50..cfde934af5c5 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c @@ -720,6 +720,8 @@ static void sctp_set_prsctp_policy(struct sctp_chunk *chunk, if (SCTP_PR_TTL_ENABLED(sinfo->sinfo_flags)) chunk->prsctp_param = jiffies + msecs_to_jiffies(sinfo->sinfo_timetolive); + else if (SCTP_PR_RTX_ENABLED(sinfo->sinfo_flags)) + chunk->prsctp_param = sinfo->sinfo_timetolive; } /* Make a DATA chunk for the given association from the provided |