Ensure that each child process in qpsmtpd-forkserver will use a

differenct sequence of ids in DNS requests.
See the thread "dnsbl or spamhaus occassionally blocks wrong IP"
starting at 14 Mar 2006 for details.


git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.3x@682 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
Peter J. Holzer 2006-12-16 09:42:52 +00:00
parent d2c79e9736
commit 72da879365

View File

@ -14,6 +14,7 @@ use IO::Select;
use Socket; use Socket;
use Getopt::Long; use Getopt::Long;
use POSIX qw(:sys_wait_h :errno_h :signal_h); use POSIX qw(:sys_wait_h :errno_h :signal_h);
use Net::DNS::Header;
use strict; use strict;
$| = 1; $| = 1;
@ -273,7 +274,10 @@ while (1) {
# otherwise child # otherwise child
# all children should have different seeds, to prevent conflicts # all children should have different seeds, to prevent conflicts
srand( time ^ ($$ + ($$ << 15)) ); srand();
for (0 .. rand(65536)) {
Net::DNS::Header::nextid();
}
close($server); close($server);