Date: Mon, 29 Mar 99 16:57:57 BST From: Terry Glanfield <terry@program-products.co.uk> To: freebsd-hackers@freebsd.org Subject: FIN not sent on socket close() Message-ID: <9903291557.AA21054@program-products.co.uk>
next in thread | raw e-mail | index | archive | help
Hi, I'm having trouble getting an FTP proxy working on 3.1-STABLE. 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. Source code available on request. 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 <mss 1326> (DF) 19:29:48.056321 10.3.1.251.49157 > 212.240.242.226.2992: S 1634641441:1634641441(0) ack 1754860720 win 17238 <mss 1326> (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] To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9903291557.AA21054>