[PATCH mptcp-next 06/16] mptcp: pm: retrans ADD_ADDR: return early if no retrans

Matthieu Baerts (NGI0) posted 16 patches 1 day, 14 hours ago
There is a newer version of this series
[PATCH mptcp-next 06/16] mptcp: pm: retrans ADD_ADDR: return early if no retrans
Posted by Matthieu Baerts (NGI0) 1 day, 14 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 e954dc46e6bc..beb06213585a 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