Skip to content

Commit 6ca328e

Browse files
lxindavem330
authored andcommitted
sctp: fix an issue that plpmtu can never go to complete state
When doing plpmtu probe, the probe size is growing every time when it receives the ACK during the Search state until the probe fails. When the failure occurs, pl.probe_high is set and it goes to the Complete state. However, if the link pmtu is huge, like 65535 in loopback_dev, the probe eventually keeps using SCTP_MAX_PLPMTU as the probe size and never fails. Because of that, pl.probe_high can not be set, and the plpmtu probe can never go to the Complete state. Fix it by setting pl.probe_high to SCTP_MAX_PLPMTU when the probe size grows to SCTP_MAX_PLPMTU in sctp_transport_pl_recv(). Also, not allow the probe size greater than SCTP_MAX_PLPMTU in the Complete state. Fixes: b87641a ("sctp: do state transition when a probe succeeds on HB ACK recv path") Signed-off-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 67caf26 commit 6ca328e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

net/sctp/transport.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,9 +324,12 @@ bool sctp_transport_pl_recv(struct sctp_transport *t)
324324
t->pl.probe_size += SCTP_PL_BIG_STEP;
325325
} else if (t->pl.state == SCTP_PL_SEARCH) {
326326
if (!t->pl.probe_high) {
327-
t->pl.probe_size = min(t->pl.probe_size + SCTP_PL_BIG_STEP,
328-
SCTP_MAX_PLPMTU);
329-
return false;
327+
if (t->pl.probe_size < SCTP_MAX_PLPMTU) {
328+
t->pl.probe_size = min(t->pl.probe_size + SCTP_PL_BIG_STEP,
329+
SCTP_MAX_PLPMTU);
330+
return false;
331+
}
332+
t->pl.probe_high = SCTP_MAX_PLPMTU;
330333
}
331334
t->pl.probe_size += SCTP_PL_MIN_STEP;
332335
if (t->pl.probe_size >= t->pl.probe_high) {
@@ -341,7 +344,7 @@ bool sctp_transport_pl_recv(struct sctp_transport *t)
341344
} else if (t->pl.state == SCTP_PL_COMPLETE) {
342345
/* Raise probe_size again after 30 * interval in Search Complete */
343346
t->pl.state = SCTP_PL_SEARCH; /* Search Complete -> Search */
344-
t->pl.probe_size += SCTP_PL_MIN_STEP;
347+
t->pl.probe_size = min(t->pl.probe_size + SCTP_PL_MIN_STEP, SCTP_MAX_PLPMTU);
345348
}
346349

347350
return t->pl.state == SCTP_PL_COMPLETE;

0 commit comments

Comments
 (0)