Changeset 1179

Show
Ignore:
Timestamp:
04/25/08 11:02:49 (6 years ago)
Author:
ahu
Message:

further randomisation improvements

Location:
trunk/pdns/pdns
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/pdns/pdns/aes/dns_random.cc

    r1171 r1179  
    2424  memcpy(g_counter+sizeof(now.tv_usec), &now.tv_sec, sizeof(now.tv_sec)); 
    2525  g_in = getpid() | (getppid()<<16); 
    26  
    27   srandom(now.tv_usec); 
     26  srandom(dns_random(numeric_limits<uint32_t>::max())); 
    2827} 
    2928 
  • trunk/pdns/pdns/pdns_recursor.cc

    r1170 r1179  
    272272    int tries=10; 
    273273    while(--tries) { 
    274       uint16_t port=1025+Utility::random()%64510; 
     274      uint16_t port=1025+dns_random(64510); 
    275275      if(tries==1)  // fall back to kernel 'random' 
    276276        port=0;