[WireGuard] [PATCH] use runtime check for getrandom syscall

Jason A. Donenfeld Jason at zx2c4.com
Sun Jul 3 01:27:14 CEST 2016

On Sat, Jul 2, 2016 at 11:39 PM, Daniel Kahn Gillmor
<dkg at fifthhorseman.net> wrote:
> Sure, but in that case why bother with the compile-time check at all,
> and why not just use getrandom(2) directly instead of syscall(2)?

So that it compiles on more platforms and I don't have to include the
syscall number myself.

> It's also possible to generate machine configs (with wg) on a machine
> that doesn't plan to run it (e.g., if you're deploying psk's through a
> configuration-management system).

That's a good point.

> With the patch, wg should just work on any of these systems.

You're right. Also, wg(8) is going to eventually handle the userspace
implementations with the exact same interface [1].

I'll reconsider this and look at it tomorrow or this week.

[1] https://www.wireguard.io/xplatform/

More information about the WireGuard mailing list