Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!husc6!sri-unix!teknowledge-vaxc!mkhaw From: mkhaw@teknowledge-vaxc.UUCP Newsgroups: comp.protocols.tcp-ip Subject: Re: closing half-open connections Message-ID: <17488@teknowledge-vaxc.ARPA> Date: Thu, 1-Oct-87 03:22:15 EDT Article-I.D.: teknowle.17488 Posted: Thu Oct 1 03:22:15 1987 Date-Received: Sat, 3-Oct-87 06:15:35 EDT References: <8709301937.AA11753@TOTO.MIT.EDU> Distribution: world Organization: Teknowledge, Inc., Palo Alto CA Lines: 84 Here's a /bin/sh driven adb script posted to the net a while back that forces a socket to close: <--- cut here ---> #! /bin/sh # original from cdjohns@NSWC-G.ARPA # # TIMETODEATH expressed in decimal instead of hex # -- mkhaw@teknowledge-vaxc.arpa # Use this script to force sockets in FIN_WAIT_2 state to close. # It works by setting the 2MSL timer in the TCP Protocol Control Block (PCB) # to a non-zero value. The kernel then begins to decrement this value until # it reaches zero, at which point the kernel forces a close on the socket and # deletes the TCP PCB. If both sides of the connection are hung, clearing one # side will possibly clear the other. # MSLOFFSET is the offset in the tcpcb record for the 2MSL timer. # describes the tcpcb record. # This value is the number of bytes offset, expressed in hexadecimal. MSLOFFSET=10 # TIMETODEATH is the number of half seconds until the connection is # closed. This value is expressed in decimal and must be greater # than zero. TIMETODEATH=06 # Display netstat to get PCB addresses (first column). echo 'Active connections PCB Proto Recv-Q Send-Q Local Address Foreign Address (state)' netstat -A | fgrep FIN_WAIT_2 echo echo -n 'PCB address to terminate? ' read addr echo # Use adb on kernel to display the PCB of the specified address adb -k /vmunix /dev/mem << SHAR_EOF $addr\$ Mike Khaw -- internet: mkhaw@teknowledge-vaxc.arpa usenet: {uunet|sun|ucbvax|decwrl|uw-beaver}!mkhaw%teknowledge-vaxc.arpa USnail: Teknowledge Inc, 1850 Embarcadero Rd, POB 10119, Palo Alto, CA 94303