# HG changeset patch # User Kim Alvefur # Date 1430070624 -7200 # Node ID 4f934cf03bc976086d04ea68d440affd5f3314c7 # Parent 6cb6855f60df1d5ee823e282c15e9c9f17bcc05e net.dns: Make sure argument to math.randomseed does not overflow a 32 bit *signed* int (blame Lua). Closes #439 diff -r 6cb6855f60df -r 4f934cf03bc9 net/dns.lua --- a/net/dns.lua Fri Apr 03 12:10:30 2015 +0200 +++ b/net/dns.lua Sun Apr 26 19:50:24 2015 +0200 @@ -225,7 +225,7 @@ function dns.random(...) -- - - - - - - - - - - - - - - - - - - dns.random - math.randomseed(math.floor(10000*socket.gettime()) % 0x100000000); + math.randomseed(math.floor(10000*socket.gettime()) % 0x80000000); dns.random = math.random; return dns.random(...); end