From 72da8793651ef79fc94c5acbda301e141858e639 Mon Sep 17 00:00:00 2001 From: "Peter J. Holzer" Date: Sat, 16 Dec 2006 09:42:52 +0000 Subject: [PATCH] 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 --- qpsmtpd-forkserver | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qpsmtpd-forkserver b/qpsmtpd-forkserver index 5d8d8b4..6504367 100755 --- a/qpsmtpd-forkserver +++ b/qpsmtpd-forkserver @@ -14,6 +14,7 @@ use IO::Select; use Socket; use Getopt::Long; use POSIX qw(:sys_wait_h :errno_h :signal_h); +use Net::DNS::Header; use strict; $| = 1; @@ -273,7 +274,10 @@ while (1) { # otherwise child # all children should have different seeds, to prevent conflicts - srand( time ^ ($$ + ($$ << 15)) ); + srand(); + for (0 .. rand(65536)) { + Net::DNS::Header::nextid(); + } close($server);