]> git.baikalelectronics.ru Git - kernel.git/commitdiff
sctp: check pl.raise_count separately from its increment
authorXin Long <lucien.xin@gmail.com>
Wed, 30 Jun 2021 03:30:36 +0000 (23:30 -0400)
committerDavid S. Miller <davem@davemloft.net>
Thu, 1 Jul 2021 18:46:44 +0000 (11:46 -0700)
As Marcelo's suggestion this will make code more clear to read.

Signed-off-by: Xin Long <lucien.xin@gmail.com>
Acked-by: Marcelo Ricardo Leitner <marcelo.leitner@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sctp/transport.c

index 5f23804f21c7db88be794c094e26d8f9e6fc699f..397a6244dd97c863f2f5bde2dd340618cb767643 100644 (file)
@@ -335,10 +335,13 @@ void sctp_transport_pl_recv(struct sctp_transport *t)
                        t->pathmtu = t->pl.pmtu + sctp_transport_pl_hlen(t);
                        sctp_assoc_sync_pmtu(t->asoc);
                }
-       } else if (t->pl.state == SCTP_PL_COMPLETE && ++t->pl.raise_count == 30) {
-               /* Raise probe_size again after 30 * interval in Search Complete */
-               t->pl.state = SCTP_PL_SEARCH; /* Search Complete -> Search */
-               t->pl.probe_size += SCTP_PL_MIN_STEP;
+       } else if (t->pl.state == SCTP_PL_COMPLETE) {
+               t->pl.raise_count++;
+               if (t->pl.raise_count == 30) {
+                       /* Raise probe_size again after 30 * interval in Search Complete */
+                       t->pl.state = SCTP_PL_SEARCH; /* Search Complete -> Search */
+                       t->pl.probe_size += SCTP_PL_MIN_STEP;
+               }
        }
 }