All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC] sctp: Update HEARTBEAT timer immediately after user changed HB.interval
@ 2014-02-18  5:56 ` Xufeng Zhang
  0 siblings, 0 replies; 9+ messages in thread
From: Xufeng Zhang @ 2014-02-18  5:56 UTC (permalink / raw)
  To: vyasevich, nhorman, davem; +Cc: linux-sctp, netdev, linux-kernel, xufeng.zhang

For an established association, if user has updated the HB.interval
parameter by setsockopt(), this new heartbeat interval will not
take effect until:
  - the expiry of the heartbeat timer and new hearbeat is sent.
  - DATA chunk has been sent and the transport resets the timer.
This could not meet the requirement of the user who need to
get HEARTBEAT sent at the specified time.

Thus, we need to update the heartbeat timer immediately after
user has changed HB.interval.

Signed-off-by: Xufeng Zhang <xufeng.zhang@windriver.com>
---
 net/sctp/socket.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 9e91d6e..699ae1e 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -2344,6 +2344,11 @@ static int sctp_apply_peer_addr_params(struct sctp_paddrparams *params,
 			if (trans) {
 				trans->hbinterval  				    msecs_to_jiffies(params->spp_hbinterval);
+
+				/* Update the heartbeat timer immediately. */
+				if (!mod_timer(&trans->hb_timer,
+					    sctp_transport_timeout(trans)))
+					sctp_transport_hold(trans);
 			} else if (asoc) {
 				asoc->hbinterval  				    msecs_to_jiffies(params->spp_hbinterval);
-- 
1.7.0.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-02-18 16:15 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-18  5:56 [PATCH RFC] sctp: Update HEARTBEAT timer immediately after user changed HB.interval Xufeng Zhang
2014-02-18  5:56 ` Xufeng Zhang
2014-02-18 12:23 ` Neil Horman
2014-02-18 12:23   ` Neil Horman
2014-02-18 14:50 ` Vlad Yasevich
2014-02-18 14:50   ` Vlad Yasevich
2014-02-18 15:39   ` David Laight
2014-02-18 16:14     ` Vlad Yasevich
2014-02-18 16:14       ` Vlad Yasevich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.