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 <kp@FreeBSD.org>
Acked-by: Gert Doering <gert@greenie.muc.de>
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 <gert@greenie.muc.de>
#include <sys/param.h>
#include <sys/linker.h>
#include <sys/nv.h>
+#include <sys/utsname.h>
+
#include <netinet/in.h>
#include "dco_freebsd.h"
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