From: Kristof Provost Date: Thu, 9 Mar 2023 12:23:32 +0000 (+0100) Subject: dco: print FreeBSD version X-Git-Tag: v2.7_alpha1~523 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=fe0853d2e72dd3a639a95e420ad7eeed6b49e81b;p=thirdparty%2Fopenvpn.git dco: print FreeBSD version Implement dco_version_string() for FreeBSD. Unlike Linux and Windows the DCO driver is built into the operating system itself, so we log the OS version as a proxy for the DCO version. Signed-off-by: Kristof Provost Acked-by: Gert Doering Message-Id: <20230309122332.92490-1-kprovost@netgate.com> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg26367.html Signed-off-by: Gert Doering --- diff --git a/src/openvpn/dco_freebsd.c b/src/openvpn/dco_freebsd.c index cbd2ce205..ecca2a076 100644 --- a/src/openvpn/dco_freebsd.c +++ b/src/openvpn/dco_freebsd.c @@ -31,6 +31,8 @@ #include #include #include +#include + #include #include "dco_freebsd.h" @@ -617,7 +619,15 @@ out: const char * dco_version_string(struct gc_arena *gc) { - return "v0"; + struct utsname *uts; + ALLOC_OBJ_GC(uts, struct utsname, gc); + + if (uname(uts) != 0) + { + return "N/A"; + } + + return uts->version; } void