Gate the TAP/kernel datapath on uBridge >= 1.3.1

uBridge 1.2.3 already has the tap module, so the persistent-TAP probes
(_probe_persistent_taps on the node, probe_tap_support and siblings for
/capabilities) pass on it. QEMU, Dynamips and VPCS nodes then anchor on
TAPs and the controller builds kernel links that need 1.3.x commands:
kernel markers and the eBPF tc modes (1.3.0) and per-interface kernel
captures (`capture stop_kernel <ifc>`, 1.3.1). On 1.2.3 a MikroTik CHR
node sent frames but never got DHCP past DISCOVER/OFFER, and stopping
a capture failed with "Bad number of parameters".

Add Hypervisor.supports_kernel_datapath (version >= 1.3.1) and refuse
older builds in the node-side probe and the four anchoring capability
probes (tap, iol tap, bridge tap, vxlan). The existing fallback then
applies: nodes keep the legacy relay datapath with the usual warning,
which now names the installed version, and links stay on the relay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
tikD1337andClaude Opus 5.5 committed 2026-10-23 15:00:27 +02:00
1 parent 4d55cb1b9c
commit 52fcc83494
6 files changed
+118 -1

No files matched your search

+11
View File
@@ -53,6 +53,7 @@ import socket
import psutil
from gns3server.compute.error import NodeError
from gns3server.compute.ubridge.hypervisor import KERNEL_DATAPATH_MINIMUM_VERSION
from gns3server.compute.ubridge.ubridge_error import UbridgeError
from gns3server.utils.tc_capabilities import FILTER_EBPF_MODES, parse_tc_capabilities, usable_ebpf_modes
@@ -158,8 +159,18 @@ class KernelDatapathMixin:
"Unknown command"/"Unknown module", a build without CAP_NET_ADMIN
fails outright. The caller composes its own warning and fallback:
the legacy relay datapath keeps working either way.
A build older than the kernel dataplane is refused without asking:
1.2.3 already has the tap module, so its `tap create` succeeds,
but the anchors it creates would then carry kernel links that need
1.3.x commands (per-interface kernel captures, kernel markers).
"""
if not self.ubridge.supports_kernel_datapath:
return UbridgeError(
f"uBridge {self.ubridge.version} is too old for the kernel datapath "
f"(>= {KERNEL_DATAPATH_MINIMUM_VERSION} required)"
)
try:
await self._ubridge_send(f'tap create "{probe_name}"')
except UbridgeError as e: