On 24 Apr 2005, at 17:01, Sidney Markowitz wrote:
This could happen if the random ID isn't random enough
May be a problem with forking. Here's part of the fork replacement I use in my code that uses the single-packet-DNS stuff:
sub _fork {
my $pid = fork;
if (!defined($pid)) { die "Cannot fork: $!" }
return $pid if $pid; # Fixup Net::DNS randomness after fork
srand($$ ^ time); local $^W;
delete $INC{'Net/DNS/Header.pm'};
require Net::DNS::Header;# cope with different versions of Net::DNS
eval {
$Net::DNS::Resolver::global{id} = 1;
$Net::DNS::Resolver::global{id} = int(rand(Net::DNS::Resolver::MAX_ID()));
# print "Next DNS ID: $Net::DNS::Resolver::global{id}\n";
};
if ($@) {
# print "Next DNS ID: " . Net::DNS::Header::nextid() . "\n";
}
... }
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email ______________________________________________________________________
