@@ -268,6 +268,27 @@ int mptcp_pm_mp_prio_send_ack(struct mptcp_sock *msk,
268268 return - EINVAL ;
269269}
270270
271+ static unsigned int mptcp_adjust_add_addr_timeout (struct mptcp_sock * msk )
272+ {
273+ const struct net * net = sock_net ((struct sock * )msk );
274+ unsigned int rto = mptcp_get_add_addr_timeout (net );
275+ struct mptcp_subflow_context * subflow ;
276+ unsigned int max = 0 ;
277+
278+ mptcp_for_each_subflow (msk , subflow ) {
279+ struct sock * ssk = mptcp_subflow_tcp_sock (subflow );
280+ struct inet_connection_sock * icsk = inet_csk (ssk );
281+
282+ if (icsk -> icsk_rto > max )
283+ max = icsk -> icsk_rto ;
284+ }
285+
286+ if (max && max < rto )
287+ rto = max ;
288+
289+ return rto ;
290+ }
291+
271292static void mptcp_pm_add_timer (struct timer_list * timer )
272293{
273294 struct mptcp_pm_add_entry * entry = timer_container_of (entry , timer ,
@@ -292,7 +313,7 @@ static void mptcp_pm_add_timer(struct timer_list *timer)
292313 goto out ;
293314 }
294315
295- timeout = mptcp_get_add_addr_timeout ( sock_net ( sk ) );
316+ timeout = mptcp_adjust_add_addr_timeout ( msk );
296317 if (!timeout )
297318 goto out ;
298319
@@ -307,7 +328,7 @@ static void mptcp_pm_add_timer(struct timer_list *timer)
307328
308329 if (entry -> retrans_times < ADD_ADDR_RETRANS_MAX )
309330 sk_reset_timer (sk , timer ,
310- jiffies + timeout );
331+ jiffies + ( timeout << entry -> retrans_times ) );
311332
312333 spin_unlock_bh (& msk -> pm .lock );
313334
@@ -348,7 +369,6 @@ bool mptcp_pm_alloc_anno_list(struct mptcp_sock *msk,
348369{
349370 struct mptcp_pm_add_entry * add_entry = NULL ;
350371 struct sock * sk = (struct sock * )msk ;
351- struct net * net = sock_net (sk );
352372 unsigned int timeout ;
353373
354374 lockdep_assert_held (& msk -> pm .lock );
@@ -374,7 +394,7 @@ bool mptcp_pm_alloc_anno_list(struct mptcp_sock *msk,
374394
375395 timer_setup (& add_entry -> add_timer , mptcp_pm_add_timer , 0 );
376396reset_timer :
377- timeout = mptcp_get_add_addr_timeout ( net );
397+ timeout = mptcp_adjust_add_addr_timeout ( msk );
378398 if (timeout )
379399 sk_reset_timer (sk , & add_entry -> add_timer , jiffies + timeout );
380400
0 commit comments