Purge 4.2BSD TCP tasks in FIN_WAIT_2

Stephen Hemminger steveh at hammer.UUCP
Mon Apr 22 06:43:06 AEST 1985


Don't apply the bug fix which sets a 2MSL timer.  This fix is wrong,
it breaks programs that use one way Inet sockets.  Example:
	rsh -n longrunningprogram >output.store &


The problem is easily fixed by the change below.
What happens is that the code was there to handle the problem but
due to control flow problems, ti->ti_len is always zero by the
time it gets to the test.

You should probably make sure have all the other problems fixed,
but that's another story...
	
(Of course if the problem is on a non Unix system you are out of luck,
and may have to go back to the original one [but use a MUCH LONGER timer
say 2 hours])
------
*** tcp_input.c.orig	Sun Apr 21 12:34:15 1985
--- tcp_input.c.finfix	Sun Apr 21 12:39:09 1985
***************
*** 328,333
  			goto dropafterack;
  		if (ti->ti_len > 0) {
  			m_adj(m, ti->ti_len);
  			ti->ti_len = 0;
  			ti->ti_flags &= ~(TH_PUSH|TH_FIN);
  		}

--- 328,342 -----
  			goto dropafterack;
  		if (ti->ti_len > 0) {
  			m_adj(m, ti->ti_len);
+  			/*
+ 			 * If data is received on a connection after the
+ 			 * user processes are gone, then RST the other end.
+ 			 */
+ 			if ((so->so_state & SS_NOFDREF) 
+ 			    && tp->t_state > TCPS_CLOSE_WAIT) {
+ 				tp = tcp_close(tp);
+ 				goto dropwithreset;
+ 			}
  			ti->ti_len = 0;
  			ti->ti_flags &= ~(TH_PUSH|TH_FIN);
  		}
***************
*** 374,389
  			ti->ti_len -= todrop;
  			ti->ti_flags &= ~(TH_PUSH|TH_FIN);
  		}
- 	}
- 
- 	/*
- 	 * If data is received on a connection after the
- 	 * user processes are gone, then RST the other end.
- 	 */
- 	if ((so->so_state & SS_NOFDREF) && tp->t_state > TCPS_CLOSE_WAIT &&
- 	    ti->ti_len) {
- 		tp = tcp_close(tp);
- 		goto dropwithreset;
  	}
  
  	/*

--- 383,388 -----
  			ti->ti_len -= todrop;
  			ti->ti_flags &= ~(TH_PUSH|TH_FIN);
  		}
  	}
  
  	/*



More information about the Comp.unix.wizards mailing list