Subject: Strange netcat behaviour on NetBSD 1.6.1
To: netbsd-users <>
From: Andreas Maus <>
List: netbsd-users
Date: 12/10/2003 22:27:58
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 1.6.1 NetBSD 1.6.1 (RABBIT) #0: Thu Nov 2=
7 23:02:51 CET 2003
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.


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.

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

Version: GnuPG v1.2.2 (GNU/Linux)