Skip to content

fix(gateway): Deliver the first DSR reply to an unresolved client router - #1551

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

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

Conversation

@privateip

Copy link
Copy Markdown
Contributor

Fixes #1550

The gateway dropped the first DSR reply to a client whose next-hop router it had not yet resolved, so that reply was lost until something else resolved the router. The gateway now hands that reply to the kernel, which resolves the router and delivers it, and counts it as a neighbour fallback instead of a drop. A reply the kernel's connection tracking rejects, such as a TCP SYN-ACK on a node running kube-proxy, is still dropped there, as before.

Test output and the reproduction before the fix are in the first comment.

edge_return dropped a reply whose route to the client had no neighbour
entry (BPF_FIB_LKUP_RET_NO_NEIGH) and counted it as fib_no_neigh. XDP
cannot start neighbour resolution, so the reply was lost until
something else resolved the neighbour, as after a neighbour flush or a
link flap.

edge_return_v6 and edge_return_v4 now return XDP_PASS on NO_NEIGH with
the frame unmodified, as edge_lb does for an encapsulated request, and
count the reply in neigh_fallbacks. The kernel decrements the hop limit
or TTL, resolves the neighbour, forwards the reply, tagging it for a
tagged public side, and later replies stay in XDP. NOT_FWDED and the
other lookup failures remain counted drops.

The fallback reply crosses netfilter with no conntrack entry, so a
reply conntrack judges INVALID, such as a TCP SYN-ACK, is still dropped
by an INVALID-dropping FORWARD rule like kube-proxy's KUBE-FORWARD.

Tests: a test run per family checks the verdict, the unchanged frame
and the counters. A real-kernel test in the VLAN transport lab leaves
the client router's neighbour unresolved and shows the first reply
reaching it through the kernel with the public side's tag, and the
second staying in XDP, for IPv4 and IPv6, untagged and tagged, in
native and generic mode.

Fixes #1550
@privateip privateip self-assigned this Dec 1, 2026
@privateip

Copy link
Copy Markdown
Contributor Author

Test evidence at d01945d1.

TestVLANTransport_ColdClientNeighborReturnFallsBack (root, real kernel) leaves the client router's neighbour unresolved, sends a reply from the fabric, and checks that it reaches the router with the public side's tag, neigh_fallbacks = 1 and fib_no_neigh = 0, then that the second reply stays in XDP.

--- PASS: TestVLANTransport_ColdClientNeighborReturnFallsBack (14.48s)
    --- PASS: .../native/ipv6/public-tagged=false/fabric-tagged=false (2.20s)
    --- PASS: .../native/ipv4/public-tagged=false/fabric-tagged=false (0.18s)
    --- PASS: .../native/ipv6/public-tagged=true/fabric-tagged=false (2.25s)
    --- PASS: .../native/ipv4/public-tagged=true/fabric-tagged=false (0.21s)
    --- PASS: .../native/ipv6/public-tagged=true/fabric-tagged=true (2.28s)
    --- PASS: .../native/ipv4/public-tagged=true/fabric-tagged=true (0.17s)
    --- PASS: .../generic/ipv6/public-tagged=false/fabric-tagged=false (2.20s)
    --- PASS: .../generic/ipv4/public-tagged=false/fabric-tagged=false (0.17s)
    --- PASS: .../generic/ipv6/public-tagged=true/fabric-tagged=false (2.20s)
    --- PASS: .../generic/ipv4/public-tagged=true/fabric-tagged=false (0.19s)
    --- PASS: .../generic/ipv6/public-tagged=true/fabric-tagged=true (2.24s)
    --- PASS: .../generic/ipv4/public-tagged=true/fabric-tagged=true (0.18s)
--- PASS: TestEdgeReturn_UnresolvedNextHopGoesToKernel (0.15s)

With only edgedsr.c reverted, both fail:

vlan_root_test.go:980: the first DSR reply never reached the unresolved client router (neigh_fallbacks=0, fib_no_neigh=1)
edgedsr_neigh_test.go:453: verdict = 1, want XDP_PASS (2)

Local checks: task build, task lint and task test:unit pass. The full edgeprog and edgeattach root suites pass in a privileged container. Lab row V07 was not run; it belongs to a later #1405 run or #1406.

A reply edge_return hands to the kernel for an unresolved neighbor counts
in galactic_edge_return_packets_total but is forwarded by the kernel, and
never counts as dropped.
@privateip
privateip marked this pull request as ready for review December 1, 2026 04:48
@privateip
privateip requested a review from a team as a code owner December 1, 2026 04:48
@privateip
privateip merged commit 40dd843 into epic/1399-vlan-transport Dec 1, 2026
35 of 36 checks passed
@privateip
privateip deleted the fix/issue-1550 branch December 1, 2026 04:48
@privateip

Copy link
Copy Markdown
Contributor Author

Review record for 7d258574.

  • pr-adversary: merge. It rebuilt the test binaries and ran TestVLANTransport_ColdClientNeighborReturnFallsBack (12 variants), TestEdgeReturn_UnresolvedNextHopGoesToKernel and the other edgeprog neighbor and VLAN transport tests in a privileged container. All passed. The 6 dispatch variants of TestVLANTransport_GatewayPaths could not run there without bpffs, and CI's root job covers them. Its nit about return counters is fixed in 7d258574.
  • pr-conventions-reviewer: merge. Nothing here deploys, and no open PR overlaps these files. Its nits were spelling and title wording.

CI is green on 7d258574. The root unit job's first run failed in attachreg (TestRegisterHostLink, ENOMEM on a map update), a package this PR does not touch, and passed on rerun.

privateip added a commit that referenced this pull request Dec 1, 2026
The lab acceptance report now holds the smoke pass of C1 and C4: the
code, deployment and run, each failing row's finding and disposition,
and the lab's state after the revert. C1 passes but for V07, which
#1551 fixes after these images. C4's datapath rows give no verdict,
because the harness left the BGP routes on the untagged parents. C4's
V11 and V13 failures are stale XDP hooks, #1552.
privateip added a commit that referenced this pull request Dec 1, 2026
The lab acceptance report now holds the smoke pass of C1 and C4: the
code, deployment and run, each failing row's finding and disposition,
and the lab's state after the revert. C1 passes but for V07, which
#1551 fixes after these images. C4's datapath rows give no verdict,
because the harness left the BGP routes on the untagged parents. C4's
V11 and V13 failures are stale XDP hooks, #1552.
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