From f313c3691770e86aa344979a326b14e6580b6532 Mon Sep 17 00:00:00 2001 From: brain Date: Wed, 2 Aug 2006 22:07:43 +0000 Subject: Pseudo-random id's again, combined with incrementing value, gettimeofday and geteuid using xor git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4661 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/dns.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/dns.cpp b/src/dns.cpp index 2a71f71df..d5c593e37 100644 --- a/src/dns.cpp +++ b/src/dns.cpp @@ -202,8 +202,9 @@ int DNSRequest::SendRequests(const DNSHeader *header, const int length, QueryTyp /* Add a query with a predefined header, and allocate an ID for it. */ DNSRequest* DNS::AddQuery(DNSHeader *header, int &id) { - id = this->currid++; - this->currid &= 0xFFFF; + timeval n; + gettimeofday(&n,NULL); + id = (n.tv_usec ^ getpid() ^ geteuid() ^ (currid++)) & 0xFFFF; DNSRequest* req = new DNSRequest(this->myserver); -- cgit v1.2.3