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
@ -5332,11 +5332,12 @@ 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 */
|
||||
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)) {
|
||||
sctp_timer_stop(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net,
|
||||
|
Loading…
x
Reference in New Issue
Block a user