Patch Set 2:

> it makes sense to cache the failure of the syscall and not attempt to use the 
> syscall at every random number generation to then fall back to gnutls

Could you elaborate why that's more efficient?

AFAIK with the way we use getrandom, it can only fail permanently iff we use it 
in a wrong way e. g. wrong flags, wrong buffer address etc. Instead of hiding 
this with GnuTLS fallback I think it's better to expose it right away to make 
sure it's fixed immediately.

In general, I think before making any such optimizations we first have to make 
some benchmark or test setup to make sure that 1) there's actually a problem 
and 2) our optimization actually improve things.

Moreover, I think GnuTLS uses getrandom internal when it's available so I doubt 
that direct getrandom() call would fail for us but succeed for GnuTLS.

Overall, I'd rather keep it as it is: isolated fallback for old systems which 
can be trivially removed once we do not have to support them anymore. Unless 
you have strong opinion to the contrary of course.

-- 
To view, visit https://gerrit.osmocom.org/4593
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic77866ce65acf524b768882c751a4f9c0635740b
Gerrit-PatchSet: 2
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Max <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <[email protected]>
Gerrit-HasComments: No

Reply via email to