Patch ID	: P94062103
Summary		: Fix several occassional TCP problems
Status		: Mandatory
Date		: 06/21/94
Release		: OS 4.1C
Architectures	: all
Affected bugs	:
	B940401001
	B940601001
	B940518002

Changed files	:
	sys/netinet/tcp_input.c (delta 1.2)
	sys/netinet/tcp_usrreq.c (delta 1.2)
	sys/netinet/tcp_debug.c (delta 1.2)
	sys/netinet/in_pcb.c (delta 1.2)
	sys/netinet/tcp_output.c (delta 1.2)
	sys/sys/trace.h (delta 1.15)
	sys/os/kern_trace.c (delta 1.3)
	sys/netinet/tcp_timer.c (delta 1.3)

Problem Description:

This patch fixes 3 different tcp problems. 

1) A rare "connection timeout" that occurs in spite of a perfectly healthy
   network. This timeout will occur if the tcp sequence number 'wraps around' 
   at exactly the wrong time. 
 
   This problem appears to have been introduced as a side effect 
   of a compatability feature. This patch introduces a variable 
   'tcp_compat_42' which can be set to 0 to avoid the connection timeouts.
   Doing this will introduce a possible compatability problem, however. 

2) Sun's patch 101499-01; Here is part of Sun's README:

    Patch-ID# 101499-01
    Keywords: sigio non-blocking i/o
    Synopsis: SunOS 4.1.3: SIGIO not generated properly for sockets.
    Date: Jan/20/94

    Solaris Release: 

    SunOS Release: 4.1.3

    Unbundled Product: 

    Unbundled Release: 

    Relevant Architectures: sun4 sun4c sun4m

    BugId's fixed with this patch: 1071377

    Changes incorporated in this version: 

    Patches accumulated and obsoleted by this patch: 

    Patches which conflict with this patch: 

    Patches required with this patch: 

    Obsoleted by: 

    Files included with this patch: 

	    tcp_input.o

    Problem Description: 

    Bug id 1071377: sigio was not being generated properly when tcp sockets
		      were used.

3) Sun's patch 100584-04; Here is part of Sun's README:

    Patch-ID# 100584-04
    Keywords: tcp loop using loopback BSD4.2 keepalive tcp_respond panic
    Synopsis: SunOS 4.1.1;4.1.2;4.1.3: system freezes using loopback interface.
    Date: Feb/07/94

    SunOS release: 4.1.1, 4.1.2, 4.1.3, 4.1.3C

    Topic: tcp loop using loopback+keepalive, tcp_respond panic

    BugID's fixed with this patch: 1053503 1151988

    Changes incorporated in this version: 1151988

    Architectures for which this patch is available: sparc

    Obsoleted by:

    Problem description:

    1053503:
	    Under certain conditions the tcp code gets in a loop
	    and continously sends acks, when using the loopback
	    interface this freezes the system.

	    Also BSD4.2 keepalive packets are handled with this
	    patch.

    1151988:
	    System panic in tcp_respond() with stack trace as follows:

    $c
    _panic(0xf0180400,0xf019c7a4,0xe26d0034,0x126,0xfd003,0xfd008e98) + b4
    _badtrap(0x24,0xfd002dc4,0xe26d0034,0x126,0x1,0x0) + 114
    _trap(0x9,0xfd002dc4,0xe26d0034,0x126,0x1,0x0) + 178
    fault(?)
    _in_pcbdetach(0x80590064,0x80590064,0xf01a4800,0x63,0xa0c,0xe26d0000) + 84
    _tcp_close(?)
    _tcp_respond(0xff66428c,0xff643a24,0x0,0x5e353001,0x4,0x8059ffff) + 7c
    _tcp_input(0xff65f50c,0x1000,0x12,0x2ddfe,0xff643a24,0xff66428c) + 1858
    _ipintr(0xff643a00,0xff005000,0x14,0x2,0x20,0xff641e0c)	+ 668
    _softint(0x0,0x8,0xf001949c,0x0,0x418001e4,0xf01a574c) + 64

    Fix description:

	    The fix includes patched version of:

		    tcp_input.o

	    It can be used on any 4.x/sparc machine

