diff options
author | Sridhar Samudrala <sri@us.ibm.com> | 2006-07-21 17:48:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2006-07-21 17:48:50 -0400 |
commit | ad8fec1720e000ba2384de6408076a60fc92a981 (patch) | |
tree | 52fd2f7af583b95db6db369c6b3ea3d6adc26d69 /net/sctp/sm_statefuns.c | |
parent | cfdeef3282705a4b872d3559c4e7d2561251363c (diff) |
[SCTP]: Verify all the paths to a peer via heartbeat before using them.
This patch implements Path Initialization procedure as described in
Sec 2.36 of RFC4460.
Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/sm_statefuns.c')
-rw-r--r-- | net/sctp/sm_statefuns.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index 9e58144f4851..e8498dce5335 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c | |||
@@ -846,6 +846,7 @@ static sctp_disposition_t sctp_sf_heartbeat(const struct sctp_endpoint *ep, | |||
846 | hbinfo.param_hdr.length = htons(sizeof(sctp_sender_hb_info_t)); | 846 | hbinfo.param_hdr.length = htons(sizeof(sctp_sender_hb_info_t)); |
847 | hbinfo.daddr = transport->ipaddr; | 847 | hbinfo.daddr = transport->ipaddr; |
848 | hbinfo.sent_at = jiffies; | 848 | hbinfo.sent_at = jiffies; |
849 | hbinfo.hb_nonce = transport->hb_nonce; | ||
849 | 850 | ||
850 | /* Send a heartbeat to our peer. */ | 851 | /* Send a heartbeat to our peer. */ |
851 | paylen = sizeof(sctp_sender_hb_info_t); | 852 | paylen = sizeof(sctp_sender_hb_info_t); |
@@ -1048,6 +1049,10 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep, | |||
1048 | return SCTP_DISPOSITION_DISCARD; | 1049 | return SCTP_DISPOSITION_DISCARD; |
1049 | } | 1050 | } |
1050 | 1051 | ||
1052 | /* Validate the 64-bit random nonce. */ | ||
1053 | if (hbinfo->hb_nonce != link->hb_nonce) | ||
1054 | return SCTP_DISPOSITION_DISCARD; | ||
1055 | |||
1051 | max_interval = link->hbinterval + link->rto; | 1056 | max_interval = link->hbinterval + link->rto; |
1052 | 1057 | ||
1053 | /* Check if the timestamp looks valid. */ | 1058 | /* Check if the timestamp looks valid. */ |