git: c91ae48a25ed - main - sctp: don't do RTT measurements with cookies
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 16 Mar 2023 09:50:36 UTC
The branch main has been updated by tuexen: URL: https://cgit.FreeBSD.org/src/commit/?id=c91ae48a25edd426efc49ade14fb675e07a0f5ed commit c91ae48a25edd426efc49ade14fb675e07a0f5ed Author: Michael Tuexen <tuexen@FreeBSD.org> AuthorDate: 2023-03-16 09:45:13 +0000 Commit: Michael Tuexen <tuexen@FreeBSD.org> CommitDate: 2023-03-16 09:45:13 +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. MFC after: 1 week --- 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 6299c5c7d827..3da483bdf37a 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, @@ -2204,17 +2194,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);