Allow sending on demand SCTP HEARTBEATS only in the ESTABLISHED state.
This issue was found by running syzkaller. MFC after: 3 days
This commit is contained in:
parent
fc26bf717c
commit
3a4f12e3b1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=347976
@ -5332,10 +5332,11 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
|
||||
net->dest_state &= ~SCTP_ADDR_NOHB;
|
||||
}
|
||||
if (paddrp->spp_flags & SPP_HB_DEMAND) {
|
||||
/* on demand HB */
|
||||
sctp_send_hb(stcb, net, SCTP_SO_LOCKED);
|
||||
sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_SOCKOPT, SCTP_SO_LOCKED);
|
||||
sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net);
|
||||
if (SCTP_GET_STATE(stcb) == SCTP_STATE_OPEN) {
|
||||
sctp_send_hb(stcb, net, SCTP_SO_LOCKED);
|
||||
sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_SOCKOPT, SCTP_SO_LOCKED);
|
||||
sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net);
|
||||
}
|
||||
}
|
||||
if ((paddrp->spp_flags & SPP_PMTUD_DISABLE) && (paddrp->spp_pathmtu >= SCTP_SMALLEST_PMTU)) {
|
||||
if (SCTP_OS_TIMER_PENDING(&net->pmtu_timer.timer)) {
|
||||
|
Loading…
Reference in New Issue
Block a user