From: Vlad Yasevich Date: Thu, 15 Nov 2007 17:13:32 +0000 (-0500) Subject: SCTP: Fix the number of HB transmissions. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fd10279bc7405c4f1e47a008686d3d9ad71d7f6d;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git SCTP: Fix the number of HB transmissions. Our treatment of Heartbeats is special in that the inital HB chunk counts against the error count for the association, where as for other chunks, only retransmissions or timeouts count against us. As a result, we had an off-by-1 situation with a number of Heartbeats we could send. Signed-off-by: Vlad Yasevich --- diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index b8bbb960723c..5fb84778846d 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c @@ -959,7 +959,7 @@ sctp_disposition_t sctp_sf_sendbeat_8_3(const struct sctp_endpoint *ep, { struct sctp_transport *transport = (struct sctp_transport *) arg; - if (asoc->overall_error_count >= asoc->max_retrans) { + if (asoc->overall_error_count > asoc->max_retrans) { sctp_add_cmd_sf(commands, SCTP_CMD_SET_SK_ERR, SCTP_ERROR(ETIMEDOUT)); /* CMD_ASSOC_FAILED calls CMD_DELETE_TCB. */