Skip to content

feat(usid): Accept SRv6 only from the selected interface's VLAN - #1537

Merged
privateip merged 3 commits into
epic/1399-vlan-transportfrom
feat/issue-1402
Nov 30, 2026
Merged

privateip merged 3 commits into
epic/1399-vlan-transportfrom
feat/issue-1402

Conversation

@privateip

@privateip privateip commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Build, lint (no in-tree issues) and the unit suite
  • Real-kernel tests: only the side's VLAN is delivered, other VLAN IDs, 802.1ad, priority and double tags are refused, and no delivered frame carries a tag
  • Real-kernel test: replies from a backend leave through the first selected VLAN interface
  • Lab verification, deferred to the end-of-epic pass

Fixes #1402

@privateip privateip self-assigned this Nov 30, 2026
@privateip privateip changed the title feat(usid): Claim SRv6 only from the side's transport VLAN feat(usid): Accept SRv6 only from the selected interface's VLAN Nov 30, 2026
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
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
@privateip
privateip marked this pull request as ready for review November 30, 2026 19:47
@privateip
privateip requested a review from a team as a code owner November 30, 2026 19:47
@privateip
privateip merged commit 8212aa1 into epic/1399-vlan-transport Nov 30, 2026
13 checks passed
@privateip
privateip deleted the feat/issue-1402 branch November 30, 2026 19:47
@privateip

Copy link
Copy Markdown
Contributor Author

Review loop record for this PR.

  • First pass at 4d5a1112. Both reviewers held. The adversarial reviewer raised two warnings:

    1. The transport VLAN rows were written after the hook attached.
    2. A VLAN that stopped validating kept its stale row.

    Both are fixed and squashed into 18fde1ce. A tamper test confirms that the stale-row test fails without the fix.

  • Second pass at f7577592. The re-reviewer confirmed both fixes and returned merge. The conventions reviewer held on two decision items:

    I applied its wording nits.

  • CI. The root job failed twice. The first failure was a Go module proxy stream error. The second was a carrier race in the new srv6 test, fixed in af31d3dd. A separate failure of TestTelemetryH3Lifecycle in internal/edge/connectip passed on rerun and is unrelated to this change.

The epic coordinator directed merging after the epic branch was merged in at ab611e40.

privateip added a commit that referenced this pull request Dec 2, 2026
feat(usid): Accept SRv6 only from the selected interface's VLAN
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant