Repository navigation
feat(usid): Accept SRv6 only from the selected interface's VLAN - #1537
Conversation
On a bond's members, and on the parent of a selected VLAN, the kernel has already moved a single 802.1Q tag into skb->vlan_tci before tc ingress, so usid_ingress saw every VLAN of the parent alike and claimed a local SID arriving on any of them, or untagged. Add transport_vlan_table, keyed by the ifindex usid_ingress runs on: a 4096-bit set of accepted VLAN IDs, bit 0 for untagged, and a counter of refused frames. After the locator match and before the claim, usid_ingress leaves a frame to the kernel when its tag is not in the row, is 802.1ad, or is a priority tag. A missing row accepts untagged frames only, so untagged deployments behave as before. attach.SyncTransport derives the rows from netlink, with no new setting: a selected VLAN netdevice accepts untagged frames, its parent and the parent's bond members accept its ID, and any other selected interface and its members accept untagged frames. Two VLANs on one parent take the union. Start and Watch write the rows before they attach, so a new hook never runs without them, and Start fails readiness if it cannot. Watch keeps each row's counter and the rows of held interfaces. A VLAN that stops validating loses its rows, leaving its parent and members untagged only. The map is new, so existing pins are untouched, and it is rewritten on every start. Correct the contract and packet-path P6, which said a tag left in packet data reaches usid_ingress: the #1401 baseline showed a single 802.1Q tag never does. Root tests cover the claim rules on a tap uplink and on a VLAN netdevice, and confirm ResolvePublicUplink picks the first selected VLAN netdevice for the DSR return. Fixes #1402
f757759 to
18fde1c
Compare
TestResolvePublicUplink_TaggedSides resolved the uplink before the bond's carrier came up, so CI's root job saw "no carrier" on the VLAN. Use an active-backup bond, whose carrier follows a member without LACP, and wait up to 5 s for the VLANs to report carrier first. Refs #1402
|
Review loop record for this PR.
The epic coordinator directed merging after the epic branch was merged in at |
feat(usid): Accept SRv6 only from the selected interface's VLAN
Summary
On a bonded or VLAN-tagged fabric, the SRv6 ingress hook accepted tenant traffic from any VLAN on the bond, not only the side's own VLAN. It now accepts only the selected interface's VLAN, or untagged traffic for an untagged side, and leaves the rest to the kernel. Untagged deployments behave as before, with no new setting.
Note
The hook uses a new kernel map that is rewritten on every start, so existing deployments upgrade without changes.
Test plan
Fixes #1402