Skip to content

Commit c919e83

Browse files
authored
Merge pull request #452 from hhrsscc/sctp-forward-tsn-issue
Sctp forward tsn issue
2 parents 582b52c + 4e6ffc6 commit c919e83

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

sctp/src/association/association_internal.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ mod association_internal_test;
33

44
use super::*;
55

6+
use crate::param::param_forward_tsn_supported::ParamForwardTsnSupported;
67
use crate::param::param_type::ParamType;
78
use crate::param::param_unrecognized::ParamUnrecognized;
89
use async_trait::async_trait;
@@ -769,6 +770,12 @@ impl AssociationInternal {
769770
self.use_forward_tsn = true;
770771
}
771772
}
773+
} else if param
774+
.as_any()
775+
.downcast_ref::<ParamForwardTsnSupported>()
776+
.is_some()
777+
{
778+
self.use_forward_tsn = true;
772779
}
773780
}
774781
if !self.use_forward_tsn {

sctp/src/chunk/chunk_init.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ impl Chunk for ChunkInit {
169169
let mut params = vec![];
170170
let mut offset = CHUNK_HEADER_SIZE + INIT_CHUNK_MIN_LENGTH;
171171
let mut remaining = raw.len() as isize - offset as isize;
172-
while remaining > INIT_OPTIONAL_VAR_HEADER_LENGTH as isize {
172+
while remaining >= INIT_OPTIONAL_VAR_HEADER_LENGTH as isize {
173173
let p = build_param(&raw.slice(offset..CHUNK_HEADER_SIZE + header.value_length()))?;
174174
let p_len = PARAM_HEADER_LENGTH + p.value_length();
175175
let len_plus_padding = p_len + get_padding_size(p_len);

0 commit comments

Comments
 (0)