summaryrefslogtreecommitdiff
path: root/src/dns.cpp
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-02 22:07:43 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-08-02 22:07:43 +0000
commitf313c3691770e86aa344979a326b14e6580b6532 (patch)
treef08e713909bdec3eb2d15efa5852d10b65bf759f /src/dns.cpp
parentd06e02bc304bc53d5f7185ae3709a46b65d69a46 (diff)
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
Diffstat (limited to 'src/dns.cpp')
-rw-r--r--src/dns.cpp5
1 files changed, 3 insertions, 2 deletions
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);