[PATCH mptcp-next v2 07/17] mptcp: pm: retrans ADD_ADDR: return early if no retrans

Matthieu Baerts (NGI0) posted 17 patches 20 hours ago
[PATCH mptcp-next v2 07/17] mptcp: pm: retrans ADD_ADDR: return early if no retrans
Posted by Matthieu Baerts (NGI0) 20 hours ago
No need to iterate over all subflows if there is no retransmission
needed.

Exit early in this case then.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 net/mptcp/pm.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
index 1c3376c01d70..6f1950462556 100644
--- a/net/mptcp/pm.c
+++ b/net/mptcp/pm.c
@@ -307,6 +307,9 @@ static unsigned int mptcp_adjust_add_addr_timeout(struct mptcp_sock *msk)
 	struct mptcp_subflow_context *subflow;
 	unsigned int max = 0, max_stale = 0;
 
+	if (!rto)
+		return 0;
+
 	mptcp_for_each_subflow(msk, subflow) {
 		struct sock *ssk = mptcp_subflow_tcp_sock(subflow);
 		struct inet_connection_sock *icsk = inet_csk(ssk);

-- 
2.53.0