Skip to content

fix(transport): Refuse invalid VLAN interfaces in the gateway and NAT - #1548

Merged
privateip merged 2 commits into
epic/1399-vlan-transportfrom
fix/issue-1546-1547
Dec 1, 2026
Merged

privateip merged 2 commits into
epic/1399-vlan-transportfrom
fix/issue-1546-1547

Conversation

@privateip

@privateip privateip commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1546
Fixes #1547

The edge gateway and the NAT shard now refuse to start when a configured interface breaks the VLAN transport contract, naming the side, interface and rule, and turn readiness off when a break appears later. The NAT shard reports a bond uplink as the bond, and refuses an uplink listed twice as an overlap. The overlap with #597 in the NAT setup code is resolved when the epic reaches main. Moving galactic-cni to Tracker.Record, and reporting transport failures in the EgressShard Ready condition, are left for later.

galactic-gateway and galactic-nat logged a transport side that failed
validation and stayed Ready. Both now resolve their configured logical
interfaces through internal/plumbing/transport before anything is
expanded to hook targets or attached:

- At startup a transport.ValidationError fails the process with the
  side, interface and rule, as galactic-cni does. A missing interface
  now fails as interface_not_found instead of an unnamed netlink error.
- On a later link or route change a failure turns the readiness
  service NOT_SERVING, keeps the current attachments, and is logged and
  counted once until it changes or clears (Tracker.Record).

galactic-nat reported its bond members as sides because it resolved
the list natattach.ResolveUplinks had already expanded. SelectUplinks
now returns the logical uplinks the shard validates, reports and fills
vlan_egress from; UplinkTargets expands them for attachment and the
uplink sysctls only. An uplink listed twice is refused as
sides_overlap.

Fixes #1546
Fixes #1547
@privateip privateip self-assigned this Dec 1, 2026
@privateip privateip changed the title fix(transport): Refuse invalid sides in the gateway and NAT fix(transport): Fail gateway and NAT startup on invalid VLAN interfaces Dec 1, 2026
@privateip

Copy link
Copy Markdown
Contributor Author

Test evidence for the head this PR opened with, 15b667f.

Test Shows
TestWaitForUplinksRefusesInvalidTransport, TestWaitForUplinksKernelTransport (NAT) interface_not_found, vlan_id_out_of_range, vlan_protocol_unsupported, stacked_vlan, parent_type_unsupported and a repeated uplink each fail startup, and the log carries reason=<rule> and the interface
TestInstallGatewayRefusesInvalidTransport, TestInstallGatewayKernelTransport (gateway) The same rules on the public and internal sides, plus public and internal on one interface
TestResyncUplinksReportsNotReadyOnInvalidTransport, TestResyncTargetsReportsNotReadyOnInvalidTransport Readiness goes NOT_SERVING when a VLAN changes to ID 0, logs once, and returns to SERVING when it is fixed
TestUplinkTransportReportsTheBondNotItsMembers, TestWaitForUplinksKernelTransport galactic_transport_side_info carries the bond, not its members

The *Kernel* tests ran as root in a privileged golang:1.26.4 container, in a private netns. For the uplinks kbond0,knic0.100, where kbond0 has members km0 and km1, the hook targets were [km0 km1 knic0.100] and the metric read:

galactic_transport_side_info{interface="kbond0",mode="untagged",parent="",side="unassigned",vlan_id=""} 1
galactic_transport_side_info{interface="knic0.100",mode="tagged",parent="knic0",side="unassigned",vlan_id="100"} 1

This PR did not use the shared lab.

@privateip privateip changed the title fix(transport): Fail gateway and NAT startup on invalid VLAN interfaces fix(transport): Refuse invalid VLAN interfaces in the gateway and NAT Dec 1, 2026
@privateip
privateip marked this pull request as ready for review December 1, 2026 02:20
@privateip
privateip requested a review from a team as a code owner December 1, 2026 02:20
@privateip
privateip merged commit c72a7e9 into epic/1399-vlan-transport Dec 1, 2026
35 of 36 checks passed
@privateip
privateip deleted the fix/issue-1546-1547 branch December 1, 2026 02:20
privateip added a commit that referenced this pull request Dec 2, 2026
fix(transport): Refuse invalid VLAN interfaces in the gateway and NAT
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