X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/39236c6e673c41db228275375ab7fdb0f837b292..143464d58d2bd6378e74eec636961ceb0d32fb91:/bsd/netinet/tcp_input.c?ds=sidebyside diff --git a/bsd/netinet/tcp_input.c b/bsd/netinet/tcp_input.c index 005d449c2..95b5b703e 100644 --- a/bsd/netinet/tcp_input.c +++ b/bsd/netinet/tcp_input.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000-2013 Apple Inc. All rights reserved. + * Copyright (c) 2000-2014 Apple Inc. All rights reserved. * * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ * @@ -3367,6 +3367,19 @@ trimthenstep6: */ if (SEQ_LEQ(th->th_ack, tp->snd_una)) { if (tlen == 0 && tiwin == tp->snd_wnd) { + /* + * If both ends send FIN at the same time, + * then the ack will be a duplicate ack + * but we have to process the FIN. Check + * for this condition and process the FIN + * instead of the dupack + */ + if ((thflags & TH_FIN) && + (tp->t_flags & TF_SENTFIN) && + !TCPS_HAVERCVDFIN(tp->t_state) && + (th->th_ack + 1) == tp->snd_max) { + break; + } process_dupack: #if MPTCP /*