fix(docker): bring the veth host end up before a relay attach

The unified veth host end is born admin-down (carrier off until a link
attaches), and libpcap cannot open a packet socket on an admin-down
interface — its netlink promiscuous-mode transaction returns ENOENT, so
'bridge add_nio_ethernet' failed on every runtime relay link (and would
on any relay link at container start). Bring the interface up for the
attach; the carrier pass in the caller refines the state afterwards (a
suspended NIO sets it back down). Verified live with a direct uBridge
probe: attach on a down veth -> ENOENT, after 'link set up' -> OK.
This commit is contained in:
YueGuobin committed 2026-10-06 00:21:08 +08:00
1 parent 2b45f29b2c
commit b1eb0984bc
2 files changed
+10

No files matched your search

+7
View File
@@ -1959,6 +1959,13 @@ class DockerVM(BaseNode):
if host_ifc is not None and bridge_name not in self._bridges:
await self._ubridge_send(f"bridge create {bridge_name}")
self._bridges.add(bridge_name)
# libpcap cannot open a packet socket on an admin-down interface
# (its netlink promiscuous-mode transaction returns ENOENT), and
# the unified veth host end is born down (carrier off until a
# link attaches) — bring it up for the relay attach. The carrier
# pass in the caller refines the state afterwards (a suspended
# NIO sets it back down).
await self._ubridge_send(f'link set "{host_ifc}" up')
await self._ubridge_send(f'bridge add_nio_ethernet {bridge_name} "{host_ifc}"')
await self._ubridge_send(
"bridge add_nio_udp {bridge_name} {lport} {rhost} {rport}".format(