On Mon, 31 Mar 2014 20:21:17 +0100 Stuart Henderson <st...@openbsd.org>
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 'Hello, World!' | nc -N -w0 -u 10.0.0.1 53


I tried that, too. It's not reliable due to a race between stdin and
0ms timeout:

dd if=/dev/zero bs=1K count=1K |md5 |./nc -u 8.8.8.8 53 >&-

if it still works, crank the count further up. I know I can use -w1
instead (that's what I currently do). But that's just a workaround, not
a fix. Also it is vulnerable by forged replies.


Christopher


-- 
http://gmerlin.de
OpenPGP: http://gmerlin.de/christopher.pub
F190 D013 8F01 AA53 E080  3F3C F17F B0A1 D44E 4FEE

Reply via email to