On 16-Dec-06, at 11:22 AM, Ask Bjørn Hansen wrote:

On Dec 16, 2006, at 2:39 AM, Peter J. Holzer wrote:

I'll be the first to admit that it is an ugly hack. I don't like it,
either. However, we need something which works with current (and even
old) versions of Net::DNS, not with some future version where the bug is
fixed.

If we can get the Net::DNS maintainer to release a newer one, how about just requiring that?

FWIW this code was different in earlier Net::DNSs, and the author now thinks this issue is fixed.

Here's how I fixed it for older Net::DNS (in some of my other code unrelated to qpsmtpd):

    # 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";
    };

Reply via email to