fix(marker): reserve "global" name prefix for future marker inheritance

This commit is contained in:
YueGuobin committed 2026-07-16 00:39:51 +08:00
1 parent d3527c00de
commit 369badc6c2
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -1093,7 +1093,7 @@ class BaseNode:
# mark <bpf> [tag <id>] [pcap <path>] — tag/pcap keyword pairs, any order.
# name travels from the controller REST layer (MarkerCreate schema) but is
# validated here too as defense-in-depth against hand-edited topology files.
_MARKER_NAME_RE = re.compile(r"^[A-Za-z0-9][A-Za-z0-9_.-]*$")
_MARKER_NAME_RE = re.compile(r"^(?i)(?!global)[A-Za-z0-9][A-Za-z0-9_.-]*$")
if not _MARKER_NAME_RE.match(name):
raise UbridgeError(f"Invalid marker name: {name!r}")
cmd = 'bridge add_packet_filter {bridge} {name} mark "{bpf}"'.format(