jedisct1 / dsvpn

A Dead Simple VPN.
MIT License
5.16k stars 393 forks source link

define SYS_getrandom if not available in Makefile #73

Closed cofyc closed 4 years ago

cofyc commented 4 years ago

fixes #72 Signed-off-by: Yecheng Fu fuyecheng@pingcap.com

llelf commented 4 years ago

What if it’s missing because…the syscall is just not there (old kernel)?

cofyc commented 4 years ago

What if it’s missing because…the syscall is just not there (old kernel)?

the syscall(SYS_getrandom, ...) call will fail. (-1 is returned).

If we want dsvpn to work on old kernels, we need to fall back to other random methods.

cofyc commented 4 years ago

I'm going to close this. As it's better if the code itself keeps assuming a modern and sane environment as suggested by @jedisct1 here.