Fix lockup handling sleep(2).
authorshort <>
Tue, 26 Oct 2004 10:22:39 +0000 (10:22 +0000)
committershort <>
Tue, 26 Oct 2004 10:22:39 +0000 (10:22 +0000)
Minor debugging message typo fixed.

netdnsspoof

index 140ffac..963c067 100755 (executable)
@@ -147,7 +147,7 @@ my($msg)=@_;
                }
        $reply->header()->id($query->header()->id());
        my $reply_back=$reply->data();
-       warn "parsing reply back to the original query host..." if $D;
+       warn "passing reply back to the original query host..." if $D;
        send $sock_udp,$reply_back,0,$query_from_addr or cluck "send(): $!";
 }
 
@@ -162,6 +162,7 @@ for (;;) {
        die "Invalid select(2): ".Dumper($got) if !defined $got || $got<0;
 
        for my $sock ($sock_udp,$sock_udp_priv) {
+               next if !vec($rfds,fileno($sock),1);
                my $msg;
                defined(my $from_addr=recv $sock,$msg,0x1000,0) or do { cluck "recv(): $!"; next; };
                warn "got packet." if $D;