From b75e5f1d2ee244d341fbf9dca3bf0d57440259b8 Mon Sep 17 00:00:00 2001 From: Mikael Persson Date: Thu, 4 Sep 2025 13:19:04 -0400 Subject: [PATCH] Support/exclude older vm-sockets kernel implementations --- toolbelt/sockets.cc | 2 +- toolbelt/sockets.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/toolbelt/sockets.cc b/toolbelt/sockets.cc index f3a8d69..78f8c73 100644 --- a/toolbelt/sockets.cc +++ b/toolbelt/sockets.cc @@ -121,7 +121,7 @@ VirtualAddress VirtualAddress::AnyAddress(uint32_t port) { return VirtualAddress(VMADDR_CID_ANY, port); } -#if defined(__linux__) +#if defined(__linux__) && defined(VMADDR_CID_LOCAL) VirtualAddress VirtualAddress::LocalAddress(uint32_t port) { return VirtualAddress(VMADDR_CID_LOCAL, port); } diff --git a/toolbelt/sockets.h b/toolbelt/sockets.h index 3535518..2dd8f4e 100644 --- a/toolbelt/sockets.h +++ b/toolbelt/sockets.h @@ -125,7 +125,7 @@ class VirtualAddress { static VirtualAddress HypervisorAddress(uint32_t port); static VirtualAddress HostAddress(uint32_t port); static VirtualAddress AnyAddress(uint32_t port); -#if defined(__linux__) +#if defined(__linux__) && defined(VMADDR_CID_LOCAL) static VirtualAddress LocalAddress(uint32_t port); #endif