Subject: Strange netcat behaviour on NetBSD 1.6.1
To: netbsd-users <netbsd-users@netbsd.org>
From: Andreas Maus <maus_andreas@web.de>
List: netbsd-users
Date: 12/10/2003 22:27:58
--5vNYLRcllDrimb99
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi *.

Yesterday I've tried to send the content of a file via netcat to
a remote host. So I set up the nc on the remote host to listan
on port 10004:

root@tigger /tmp # nc -v -p 10004 -l
listening on [any] 10004 ...

Than I go to the NetBSD system and do a:

root@rabbit /tmp # uname -a
NetBSD rabbit.badphish.dyndns.org 1.6.1 NetBSD 1.6.1 (RABBIT) #0: Thu Nov 2=
7 23:02:51 CET 2003     root@rabbit.badphish.dyndns.org:/usr/src/sys/arch/i=
386/compile/RABBIT i386

root@rabbit /tmp # cat tindny-09-Dec-2003.log | nc tigger 10004

No problem so far ... until cat reaches the end of the file.
The nc process on rabbit continues to read from stdin.
I can see the last line of the file on the remote side
but the connection wont be closed and the command line from
the sender (rabbit) still remains "active".

If I login to another system (not NetBSD) and try the
cat ... | nc ... command everything works fine and
the nc process terminates if cat is done with the file.
Works fine on OpenBSD 3.4, FreeBSD 5.1 and Linux 2.4.22
and 2.6.0-test11. The netcat version is the same on every
system. It is v1.10 (nc -h says so) and the file I read
via cat is a regular file.

Is there anyone out there who can point me to the solution?

Many thanks in advance.

Andreas.

--=20
Windows 95: A 32-bit patch for a 16-bit GUI shell running on top of
an 8-bit operating system written for a 4-bit processor by a 2-bit
company who cannot stand 1 bit of competition.

--5vNYLRcllDrimb99
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iQEVAwUBP9eP3hiWFyevgxstAQFmewf+Pl9L8qlF80PTFIl9ZaLcJr5DE+pY6baz
zkIhKYgCLDU6tEPHYxaQUTtJFJnNEPlaqQSsiFK5xn53sB99rGDqLU3n9lx8I9VW
poVHxkzImvUm39pLFGIUV9LUBXoUVQpgSCHex/lCRYrLCZ/PcdlyO3+q7hKawxcr
t094Hgm/gTI2X+RXFz0fuUaN0wF8CkdiBTYMqqtVaHthm3/kS5CjKa3uhoVbtkP+
2SICuJzCVHESxJTkcMtLvX6nxCpmja69ZKj5tAqfWrj60hsNOxL8dNIXbA/GJI/a
T+wrimaqGjSVrlHMwf9v/58vqfwIZaYObd22HgNzpSRIRBdU/kuiBA==
=1U+s
-----END PGP SIGNATURE-----

--5vNYLRcllDrimb99--