Skip to content

Commit

Permalink
Merge pull request #452 from hhrsscc/sctp-forward-tsn-issue
Browse files Browse the repository at this point in the history
Sctp forward tsn issue
  • Loading branch information
yngrtc authored Jun 4, 2023
2 parents 582b52c + 4e6ffc6 commit c919e83
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions sctp/src/association/association_internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ mod association_internal_test;

use super::*;

use crate::param::param_forward_tsn_supported::ParamForwardTsnSupported;
use crate::param::param_type::ParamType;
use crate::param::param_unrecognized::ParamUnrecognized;
use async_trait::async_trait;
Expand Down Expand Up @@ -769,6 +770,12 @@ impl AssociationInternal {
self.use_forward_tsn = true;
}
}
} else if param
.as_any()
.downcast_ref::<ParamForwardTsnSupported>()
.is_some()
{
self.use_forward_tsn = true;
}
}
if !self.use_forward_tsn {
Expand Down
2 changes: 1 addition & 1 deletion sctp/src/chunk/chunk_init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ impl Chunk for ChunkInit {
let mut params = vec![];
let mut offset = CHUNK_HEADER_SIZE + INIT_CHUNK_MIN_LENGTH;
let mut remaining = raw.len() as isize - offset as isize;
while remaining > INIT_OPTIONAL_VAR_HEADER_LENGTH as isize {
while remaining >= INIT_OPTIONAL_VAR_HEADER_LENGTH as isize {
let p = build_param(&raw.slice(offset..CHUNK_HEADER_SIZE + header.value_length()))?;
let p_len = PARAM_HEADER_LENGTH + p.value_length();
let len_plus_padding = p_len + get_padding_size(p_len);
Expand Down

0 comments on commit c919e83

Please sign in to comment.