Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 (Tek) 9/28/84 based on 9/17/84; site hammer.UUCP Path: utzoo!watmath!clyde!bonnie!akgua!mcnc!decvax!tektronix!orca!hammer!steveh From: steveh@hammer.UUCP (Stephen Hemminger) Newsgroups: net.unix-wizards Subject: Re: Purge 4.2BSD TCP tasks in FIN_WAIT_2 Message-ID: <1179@hammer.UUCP> Date: Sun, 21-Apr-85 15:43:06 EST Article-I.D.: hammer.1179 Posted: Sun Apr 21 15:43:06 1985 Date-Received: Wed, 24-Apr-85 02:38:14 EST References: <377@wdl1.UUCP> <1661@ut-sally.UUCP> Reply-To: steveh@hammer.UUCP (Stephen Hemminger) Organization: Tektronix, Wilsonville OR Lines: 70 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); } } /*