From owner-freebsd-stable Fri Mar 26 12: 3:33 1999 Delivered-To: freebsd-stable@freebsd.org Received: from mailgate.program-products.co.uk (samson.program-products.co.uk [212.240.242.226]) by hub.freebsd.org (Postfix) with ESMTP id 351AE1505A for ; Fri, 26 Mar 1999 12:03:25 -0800 (PST) (envelope-from terry@program-products.co.uk) Received: by mailgate.program-products.co.uk via smap (V2.1) id xma008693; Fri, 26 Mar 99 20:02:36 GMT Date: Fri, 26 Mar 99 20:02:34 GMT Message-Id: <9903262002.AA15201@program-products.co.uk> From: Terry Glanfield To: freebsd-stable@freebsd.org Subject: FIN not send on socket close() Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, I'm having trouble getting an FTP proxy working on 3.1-STABLE (~1 week old). The proxy is a PASV aware version of the FTWK ftp-gw. When trying to STOR a file through the proxy the receiving end hangs waiting for a FIN packet that is never sent. The ktrace output below shows the socket being closed. I've also included some short packet traces - sorry about the line length - and dumps of a pftp session for comparison. The only difference I can see is that the proxy is being launched from inetd. Any help would be greatly appreciated. Cheers, Terry. Fristly the traces from the proxy version. Receiver: 6952 ftpd CALL read(0x8,0xefbfcfbc,0x400) 6952 ftpd GIO fd 8 read 5 bytes "test " 6952 ftpd RET read 5 6952 ftpd CALL write(0x7,0xefbfcfbc,0x5) 6952 ftpd GIO fd 7 wrote 5 bytes "test " 6952 ftpd RET write 5 6952 ftpd CALL read(0x8,0xefbfcfbc,0x400) >>read never returns... Sender: 8543 ftp-gw CALL read(0x8,0xefbfce5c,0x800) 8543 ftp-gw GIO fd 8 read 5 bytes "test " 8543 ftp-gw RET read 5 8543 ftp-gw CALL write(0x7,0xefbfce5c,0x5) 8543 ftp-gw GIO fd 7 wrote 5 bytes "test " 8543 ftp-gw RET write 5 8543 ftp-gw CALL select(0x400,0xefbfdcb0,0,0,0xefbfdd30) 8543 ftp-gw RET select 1 8543 ftp-gw CALL read(0x8,0xefbfce5c,0x800) 8543 ftp-gw GIO fd 8 read 0 bytes "" 8543 ftp-gw RET read 0 8543 ftp-gw CALL close(0x8) 8543 ftp-gw RET close 0 8543 ftp-gw CALL close(0x7) 8543 ftp-gw RET close 0 >>... but the socket is closed Here are the traces from the pftp version. Receiver: 6966 ftpd CALL read(0x8,0xefbfcfbc,0x400) 6966 ftpd GIO fd 8 read 5 bytes "test " 6966 ftpd RET read 5 6966 ftpd CALL write(0x7,0xefbfcfbc,0x5) 6966 ftpd GIO fd 7 wrote 5 bytes "test " 6966 ftpd RET write 5 6966 ftpd CALL read(0x8,0xefbfcfbc,0x400) 6966 ftpd GIO fd 8 read 0 bytes "" 6966 ftpd RET read 0 >>read returns cleanly... 6966 ftpd CALL write(0x1,0x8059000,0x18) 6966 ftpd GIO fd 1 wrote 24 bytes "226 Transfer complete.\r " Sender: 8595 pftp CALL read(0x4,0xefbfd3e4,0x400) 8595 pftp GIO fd 4 read 5 bytes "test " 8595 pftp RET read 5 8595 pftp CALL write(0x5,0xefbfd3e4,0x5) 8595 pftp GIO fd 5 wrote 5 bytes "test " 8595 pftp RET write 5 8595 pftp CALL read(0x4,0xefbfd3e4,0x400) 8595 pftp GIO fd 4 read 0 bytes "" 8595 pftp RET read 0 8595 pftp CALL gettimeofday(0xefbfd290,0) 8595 pftp RET gettimeofday 0 8595 pftp CALL write(0x1,0xefbfd298,0x1c) 8595 pftp GIO fd 1 wrote 28 bytes "\r100% 5 00:00 ETA" 8595 pftp RET write 28/0x1c 8595 pftp CALL setitimer(0,0xefbfd234,0) 8595 pftp RET setitimer 0 8595 pftp CALL write(0x1,0x8069000,0x1) 8595 pftp GIO fd 1 wrote 1 byte " " 8595 pftp RET write 1 8595 pftp CALL close(0x4) 8595 pftp RET close 0 8595 pftp CALL close(0x5) 8595 pftp RET close 0 8595 pftp CALL sigaction(0x2,0xefbfcf50,0xefbfcf44) 8595 pftp RET sigaction 0 8595 pftp CALL read(0x3,0x8079000,0x4356) 8595 pftp GIO fd 3 read 24 bytes "226 Transfer complete.\r " Finally the packet traces. Proxy version: 19:29:48.050523 212.240.242.226.2990 > 10.3.1.251.21: P 1748251412:1748251418(6) ack 1627790365 win 17238 (DF) 19:29:48.054606 10.3.1.251.21 > 212.240.242.226.2990: P 1:47(46) ack 6 win 17238 (DF) [tos 0x10] 19:29:48.055582 212.240.242.226.2992 > 10.3.1.251.49157: S 1754860719:1754860719(0) win 16384 (DF) 19:29:48.056321 10.3.1.251.49157 > 212.240.242.226.2992: S 1634641441:1634641441(0) ack 1754860720 win 17238 (DF) 19:29:48.056656 212.240.242.226.2992 > 10.3.1.251.49157: . ack 1 win 17238 (DF) 19:29:48.066298 212.240.242.226.2990 > 10.3.1.251.21: P 6:14(8) ack 47 win 17238 (DF) 19:29:48.072126 10.3.1.251.21 > 212.240.242.226.2990: P 47:97(50) ack 14 win 17238 (DF) [tos 0x10] 19:29:48.075895 212.240.242.226.2992 > 10.3.1.251.49157: P 1:6(5) ack 1 win 17238 (DF) 19:29:48.116205 212.240.242.226.2990 > 10.3.1.251.21: . ack 97 win 17238 (DF) 19:29:48.275329 10.3.1.251.49157 > 212.240.242.226.2992: . ack 6 win 17238 (DF) [tos 0x8] pftp version: 19:35:11.579785 212.240.242.226.2998 > 10.3.1.251.21: P 1809781922:1809781928(6) ack 1688388446 win 17238 (DF) [tos 0x10] 19:35:11.584555 10.3.1.251.21 > 212.240.242.226.2998: P 1:47(46) ack 6 win 17238 (DF) [tos 0x10] 19:35:11.587443 212.240.242.226.2999 > 10.3.1.251.49158: S 1817760134:1817760134(0) win 16384 (DF) 19:35:11.588171 10.3.1.251.49158 > 212.240.242.226.2999: S 1696091157:1696091157(0) ack 1817760135 win 17238 (DF) 19:35:11.588500 212.240.242.226.2999 > 10.3.1.251.49158: . ack 1 win 17238 (DF) 19:35:11.589643 212.240.242.226.2998 > 10.3.1.251.21: P 6:14(8) ack 47 win 17238 (DF) [tos 0x10] 19:35:11.593372 10.3.1.251.21 > 212.240.242.226.2998: P 47:97(50) ack 14 win 17238 (DF) [tos 0x10] 19:35:11.597962 212.240.242.226.2999 > 10.3.1.251.49158: P 1:6(5) ack 1 win 17238 (DF) [tos 0x8] 19:35:11.601319 212.240.242.226.2999 > 10.3.1.251.49158: F 6:6(0) ack 1 win 17238 (DF) [tos 0x8] 19:35:11.601936 10.3.1.251.49158 > 212.240.242.226.2999: . ack 7 win 17238 (DF) [tos 0x8] 19:35:11.602827 10.3.1.251.21 > 212.240.242.226.2998: P 97:121(24) ack 14 win 17238 (DF) [tos 0x10] 19:35:11.603530 10.3.1.251.49158 > 212.240.242.226.2999: F 1:1(0) ack 7 win 17238 (DF) [tos 0x8] 19:35:11.603833 212.240.242.226.2999 > 10.3.1.251.49158: . ack 2 win 17238 (DF) [tos 0x8] To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message