aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tuexen <tuexen@FreeBSD.org>2021-04-30 11:31:38 +0000
committerMichael Tuexen <tuexen@FreeBSD.org>2021-06-02 21:47:00 +0000
commit1f663bc4baeb984a256f939eb6e019e61f400e3b (patch)
tree76a210a08c8c677876822a7bcfbb1e85fc56c351
parent4e71474ed97a39aa8f0c6fcfa9136555dde89d64 (diff)
downloadsrc-1f663bc4baeb984a256f939eb6e019e61f400e3b.tar.gz
src-1f663bc4baeb984a256f939eb6e019e61f400e3b.zip
sctp: update the vtag for INIT and INIT-ACK chunks
This is needed in case of responding with an ABORT to an INIT-ACK. (cherry picked from commit e010d20032c8c2a04da103b3402a8d24bd682dd5)
-rw-r--r--sys/netinet/sctputil.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c
index 5d4b3347a2c9..2c10ab158c83 100644
--- a/sys/netinet/sctputil.c
+++ b/sys/netinet/sctputil.c
@@ -4553,7 +4553,7 @@ sctp_handle_ootb(struct mbuf *m, int iphlen, int offset,
* if there is return 1, else return 0.
*/
int
-sctp_is_there_an_abort_here(struct mbuf *m, int iphlen, uint32_t *vtagfill)
+sctp_is_there_an_abort_here(struct mbuf *m, int iphlen, uint32_t *vtag)
{
struct sctp_chunkhdr *ch;
struct sctp_init_chunk *init_chk, chunk_buf;
@@ -4574,12 +4574,13 @@ sctp_is_there_an_abort_here(struct mbuf *m, int iphlen, uint32_t *vtagfill)
/* yep, tell them */
return (1);
}
- if (ch->chunk_type == SCTP_INITIATION) {
+ if ((ch->chunk_type == SCTP_INITIATION) ||
+ (ch->chunk_type == SCTP_INITIATION_ACK)) {
/* need to update the Vtag */
init_chk = (struct sctp_init_chunk *)sctp_m_getptr(m,
- offset, sizeof(*init_chk), (uint8_t *)&chunk_buf);
+ offset, sizeof(struct sctp_init_chunk), (uint8_t *)&chunk_buf);
if (init_chk != NULL) {
- *vtagfill = ntohl(init_chk->init.initiate_tag);
+ *vtag = ntohl(init_chk->init.initiate_tag);
}
}
/* Nope, move to the next chunk */