- if ((n->th_flags&TH_FIN) && (tp->tc_flags&TC_DROPPED_TXT) == 0) {
- seq_t last;
-
- if ((tp->tc_flags&TC_FIN_RCVD) == 0) {
- /* do we really have fin ? */
- last = firstempty(tp);
- if (tp->t_rcv_prev == (struct th *)tp ||
- last == t_end(tp->t_rcv_prev)) {
- tp->tc_flags |= TC_FIN_RCVD;
- netwakeup(tp->t_ucb); /* poke */
- }
- if ((tp->tc_flags&TC_FIN_RCVD) &&
- tp->rcv_nxt >= last) {
- tp->rcv_nxt = last + 1; /* fin seq */
+ if ((thflags&TH_FIN) &&
+ (tp->tc_flags&TC_DROPPED_TXT) == 0) {
+ seq_t last;
+
+ if ((tp->tc_flags&TC_FIN_RCVD) == 0) {
+ /* do we really have fin ? */
+ last = firstempty(tp);
+ if (tp->tcb_hd.seg_prev == (struct th *)tp ||
+ last == t_end(tp->tcb_hd.seg_prev)) {
+ tp->tc_flags |= TC_FIN_RCVD;
+ sowakeup(tp->t_socket); /* ### */
+ }
+ if ((tp->tc_flags&TC_FIN_RCVD) &&
+ tp->rcv_nxt >= last) {
+ tp->rcv_nxt = last + 1;
+ tp->tc_flags |= TC_ACK_DUE;
+ }
+ } else