fix(iou): keep BridgeNIO filters across the NIO update route

Upstream's mypy pass narrowed the filter copy to UDPNIO only (the
Ethernet/TAP members of the union have no filters field). BridgeNIO —
the kernel-datapath NIO — carries filters too, so on an IOU kernel link
every PUT of a link's filters cleared them and applied nothing: netem
never landed on the anchor (e2e test_iou_kernel_datapath caught it).

Narrow to (UDPNIO, BridgeNIO): still avoids attribute access on the
models without the field, keeps both filter-carrying types.
This commit is contained in:
YueGuobin 2026-10-05 12:53:28 +08:00
parent 7d04d08dba
commit dc5e2d90ba
No known key found for this signature in database

View File

@ -225,7 +225,9 @@ async def update_iou_node_nio(
nio = node.get_nio(adapter_number, port_number)
nio.filters.clear()
if isinstance(nio_data, schemas.UDPNIO) and nio_data.filters:
# EthernetNIO/TAPNIO carry no filters field; UDPNIO (relay) and
# BridgeNIO (kernel datapath) both do.
if isinstance(nio_data, (schemas.UDPNIO, schemas.BridgeNIO)) and nio_data.filters:
nio.filters = nio_data.filters
# NIO type is a Union (Ethernet/TAP/UDP/bridge); only UDPNIO and
# BridgeNIO carry markers and suspend. Suspend is what the compute turns