Wei Yongjun wrote: > The number of HEARTBEAT chunks that an association may transmit is > limited by Association.Max.Retrans count; however, the code allows > us to send one extra heartbeat. > > This patch limits the number of heartbeats to the maximum count. > > Signed-off-by: Wei Yongjun <yjwei@xxxxxxxxxxxxxx> > --- > net/sctp/sm_statefuns.c | 2 +- > 1 files changed, 1 insertions(+), 1 deletions(-) > > diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c > index 3e7f6d2..ac7bf6d 100644 > --- a/net/sctp/sm_statefuns.c > +++ b/net/sctp/sm_statefuns.c > @@ -962,7 +962,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. */ Hi Wei Here is the spec: The endpoint should increment the respective error counter of the destination transport address each time a HEARTBEAT is sent to that address and not acknowledged within one RTO. When the value of this counter reaches the protocol parameter 'Path.Max.Retrans', the endpoint should mark the corresponding destination address as inactive... According to this, only unacknowledged HB count as errors. The very first HB we sent doest count as an error until the RTO expires. So the >= is the correct test here as we are really counting the number of timeouts with reacknowledgment. -vlad -- To unsubscribe from this list: send the line "unsubscribe linux-sctp" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html