Re: half-duplex netcat with closed stdout / stdin

2014-03-31 Thread Christopher Zimmermann
On Mon, 31 Mar 2014 20:21:17 +0100 Stuart Henderson wrote: > On 2014/03/31 20:33, Christopher Zimmermann wrote: > > But our netcat won't ever terminate when used for sending an udp > > datagram: > > > > $ echo 'Hello, World!' |nc -Nu 8.8.8.8 53 > > this seems to work though ... > > $ echo 'Hel

Re: half-duplex netcat with closed stdout / stdin

2014-03-31 Thread Stuart Henderson
On 2014/03/31 20:33, Christopher Zimmermann wrote: > But our netcat won't ever terminate when used for sending an udp > datagram: > > $ echo 'Hello, World!' |nc -Nu 8.8.8.8 53 this seems to work though ... $ echo 'Hello, World!' | nc -N -w0 -u 10.0.0.1 53

Re: half-duplex netcat with closed stdout / stdin

2014-03-31 Thread Christopher Zimmermann
I just noticed I broke nc -kl. Here is the fix: --- netcat.c.list Mon Mar 31 21:03:39 2014 +++ netcat.cMon Mar 31 21:03:44 2014 @@ -763,7 +763,7 @@ if (nostdin && Nflag) shutdown(nfd, SHUT_WR); if (nostdout) shutdown(nfd, SHUT_RD); - while (pfd[0].fd != -1 || pfd

half-duplex netcat with closed stdout / stdin

2014-03-31 Thread Christopher Zimmermann
Hi, I need a shell utility for sending udp datagrams. Of course netcat is the tool of choice for this purpose. But our netcat won't ever terminate when used for sending an udp datagram: $ echo 'Hello, World!' |nc -Nu 8.8.8.8 53 also our netcat shows undefined behavior when started with closed st