diff options
| -rw-r--r-- | include/net/sctp/command.h | 1 | ||||
| -rw-r--r-- | net/sctp/sm_sideeffect.c | 5 | ||||
| -rw-r--r-- | net/sctp/sm_statefuns.c | 11 |
3 files changed, 12 insertions, 5 deletions
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h index 67524f0b1a03..b1fba0151675 100644 --- a/include/net/sctp/command.h +++ b/include/net/sctp/command.h @@ -85,6 +85,7 @@ typedef enum { SCTP_CMD_UPDATE_ASSOC, /* Update association information. */ SCTP_CMD_PURGE_OUTQUEUE, /* Purge all data waiting to be sent. */ SCTP_CMD_SETUP_T2, /* Hi-level, setup T2-shutdown parms. */ + SCTP_CMD_RTO_PENDING, /* Set transport's rto_pending. */ SCTP_CMD_LAST } sctp_verb_t; diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c index 5cf467eaab8b..1b8eb76f689e 100644 --- a/net/sctp/sm_sideeffect.c +++ b/net/sctp/sm_sideeffect.c @@ -595,6 +595,11 @@ int sctp_cmd_interpreter(sctp_event_t event_type, sctp_subtype_t subtype, chunk->pdiscard = 1; break; + case SCTP_CMD_RTO_PENDING: + t = command->obj.transport; + t->rto_pending = 1; + break; + default: printk(KERN_WARNING "Impossible command: %u, %p\n", command->verb, command->obj.ptr); diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index f8830fc33079..4ddd1146bf5a 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c @@ -680,17 +680,18 @@ sctp_disposition_t sctp_sf_heartbeat(const sctp_endpoint_t *ep, hbinfo.daddr = transport->ipaddr; hbinfo.sent_at = jiffies; - /* Set rto_pending indicating that an RTT measurement - * is started with this heartbeat chunk. - */ - transport->rto_pending = 1; - /* Send a heartbeat to our peer. */ paylen = sizeof(sctp_sender_hb_info_t); reply = sctp_make_heartbeat(asoc, transport, &hbinfo, paylen); if (!reply) return SCTP_DISPOSITION_NOMEM; + /* Set rto_pending indicating that an RTT measurement + * is started with this heartbeat chunk. + */ + sctp_add_cmd_sf(commands, SCTP_CMD_RTO_PENDING, + SCTP_TRANSPORT(transport)); + sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(reply)); return SCTP_DISPOSITION_CONSUME; } |
