+ /*
+ * 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;
+ }