d2g / dhcp4client

DHCP Client
Mozilla Public License 2.0
38 stars 30 forks source link

use math/rand instead of crypto/rand. #13

Closed rminnich closed 6 years ago

rminnich commented 7 years ago

crypto/rand can take up to 5 minutes to be ready, and this is really killing our boot time on facebook OCP nodes. It needs to be working in 15 seconds from power on.

d2g commented 7 years ago

Latest Commit adds support for this although doesn't change the use of crypto/rand in the sktpacket implementation. Awaiting confirmation from @rminnich that this needs to be changed also.

d2g commented 7 years ago

Can you try the #13LinuxRandUpdate branch. To use the math.rand on the socket you should be able to pass the packed the function to use. Sorry it's a bit rough and ready I don't have a Linux machine easily available and so I've been reliant on the codeship service just to check that the changes actually build.

dhcp4client.NewPacketSock(1,dhcp4client.RandFunc(Math.Rand))

rminnich commented 7 years ago

I hope to try this this week. It's been a bit crazy as the root file system I do this testing on got trashed. By me. Oh well.

On Tue, Sep 5, 2017 at 5:45 AM Dan Goldsmith notifications@github.com wrote:

Can you try the #13LinuxRandUpdate branch. To use the math.rand on the socket you should be able to pass the packed the function to use. Sorry it's a bit rough and ready I don't have a Linux machine easily available and so I've been reliant on the codeship service just to check that the changes actually build.

dhcp4client.NewPacketSock(1,dhcp4client.RandFunc(Math.Rand))

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/d2g/dhcp4client/pull/13#issuecomment-327164309, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEksDkHNxUp-z0yAWYMO-gQaoiYzFPWks5sfUKFgaJpZM4PDPHG .