develooper Front page | perl.qpsmtpd | Postings from March 2006

Re: dnsbl or spamhaus occassionally blocks wrong IP

Thread Previous | Thread Next
From:
Peter J. Holzer
Date:
March 18, 2006 14:30
Subject:
Re: dnsbl or spamhaus occassionally blocks wrong IP
Message ID:
20060318223000.GE17342@teal.hjp.at
On 2006-03-14 23:38:45 +0100, Peter J. Holzer wrote:
> On 2006-03-14 16:36:13 -0500, John Peacock wrote:
> > Can we poke a new ID value manually for each fork instance?
> 
> Yes. It's ugly but it works:
> 
>         srand();
>         for (0 .. rand(65536)) {
>             Net::DNS::Header::nextid();
>         }

I see that qpsmtpd-forkserver calls:

    srand( time ^ ($$ + ($$ << 15)) );

Is this wise? According to the manual, the default value

                                   is based on time of day, pro­
               cess ID, and memory allocation, or the /dev/uran­
               dom device, if available.

so just calling srand() should be at least as random as the code above.
(We aren't worried about compatibility with perl 5.003, are we?)

	hp



-- 
   _  | Peter J. Holzer    | Ich sehe nun ein, dass Computer wenig
|_|_) | Sysadmin WSR       | geeignet sind, um sich was zu merken.
| |   | hjp@hjp.at         |
__/   | http://www.hjp.at/ |	-- Holger Lembke in dan-am

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About