git: 180136462aa9 - stable/13 - sctp: don't do RTT measurements with cookies

From: Michael Tuexen <tuexen_at_FreeBSD.org>
Date: Sun, 25 Jun 2023 19:34:08 UTC
The branch stable/13 has been updated by tuexen:

URL: https://cgit.FreeBSD.org/src/commit/?id=180136462aa9c941dcfffcf3abee8f452f1565c8

commit 180136462aa9c941dcfffcf3abee8f452f1565c8
Author:     Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2023-03-16 09:45:13 +0000
Commit:     Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2023-06-25 19:33:35 +0000

    sctp: don't do RTT measurements with cookies
    
    When receiving a cookie, the receiver does not know whether the
    peer retransmitted the COOKIE-ECHO chunk or not. Therefore, don't
    do an RTT measurement. It might be much too long.
    To overcome this limitation, one could do at least two things:
    1. Bundle the INIT-ACK chunk with a HEARTBEAT chunk for doing the
       RTT measurement. But this is not allowed.
    2. Add a flag to the COOKIE-ECHO chunk, which indicates that it
       is the initial transmission, and not a retransmission. But
       this requires an RFC.
    
    (cherry picked from commit c91ae48a25edd426efc49ade14fb675e07a0f5ed)
---
 sys/netinet/sctp_input.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/sys/netinet/sctp_input.c b/sys/netinet/sctp_input.c
index 836f09f4887f..a0e0d683b5fe 100644
--- a/sys/netinet/sctp_input.c
+++ b/sys/netinet/sctp_input.c
@@ -1351,7 +1351,6 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset,
 	struct sctp_queued_to_read *sq, *nsq;
 	struct sctp_nets *net;
 	struct mbuf *op_err;
-	struct timeval old;
 	int init_offset, initack_offset, i;
 	int retval;
 	int spec_flag = 0;
@@ -1499,16 +1498,7 @@ sctp_process_cookie_existing(struct mbuf *m, int iphlen, int offset,
 			}
 			/* notify upper layer */
 			*notification = SCTP_NOTIFY_ASSOC_UP;
-			/*
-			 * since we did not send a HB make sure we don't
-			 * double things
-			 */
-			old.tv_sec = cookie->time_entered.tv_sec;
-			old.tv_usec = cookie->time_entered.tv_usec;
 			net->hb_responded = 1;
-			sctp_calculate_rto(stcb, asoc, net, &old,
-			    SCTP_RTT_FROM_NON_DATA);
-
 			if (stcb->asoc.sctp_autoclose_ticks &&
 			    (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_AUTOCLOSE))) {
 				sctp_timer_start(SCTP_TIMER_TYPE_AUTOCLOSE,
@@ -2202,17 +2192,11 @@ sctp_process_cookie_new(struct mbuf *m, int iphlen, int offset,
 	(void)SCTP_GETTIME_TIMEVAL(&stcb->asoc.time_entered);
 	*netp = sctp_findnet(stcb, init_src);
 	if (*netp != NULL) {
-		struct timeval old;
-
 		/*
 		 * Since we did not send a HB, make sure we don't double
 		 * things.
 		 */
 		(*netp)->hb_responded = 1;
-		/* Calculate the RTT. */
-		old.tv_sec = cookie->time_entered.tv_sec;
-		old.tv_usec = cookie->time_entered.tv_usec;
-		sctp_calculate_rto(stcb, asoc, *netp, &old, SCTP_RTT_FROM_NON_DATA);
 	}
 	/* respond with a COOKIE-ACK */
 	sctp_send_cookie_ack(stcb);