Skip to content

fix(controller): enable ARP learning on VPC routers that have peerings - #6882

Merged
oilbeater merged 2 commits into
kubeovn:masterfrom
LoneExile:fix/vpc-peering-arp-learn
Jun 18, 2026
Merged

fix(controller): enable ARP learning on VPC routers that have peerings#6882
oilbeater merged 2 commits into
kubeovn:masterfrom
LoneExile:fix/vpc-peering-arp-learn

Conversation

@LoneExile

Copy link
Copy Markdown
Contributor

Description

VPC peering requires ARP learning on the logical router.

When traffic arrives from a peered VPC, it enters via the peer LRP. If always_learn_from_arp_request=false, the destination pod's MAC is never learned into mac_binding, so the router mis-forwards the packet (tunnels it instead of delivering locally).

Currently learnFromARPRequest is only set for EnableExternal and the U2O interconnection case. This change also enables it when the VPC has any VpcPeerings.

Impact

  • Fixes cross-VPC L2 delivery for peered VPCs.
  • No behavior change for VPCs without peerings.
  • Minimal and safe.

Copilot AI review requested due to automatic review settings June 17, 2026 04:38
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Jun 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates VPC handling logic so ARP learning behavior is enabled when VPC peerings are configured, not only when external networking is enabled.

Changes:

  • Extend learnFromARPRequest condition to also consider presence of vpc.Spec.VpcPeerings.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pkg/controller/vpc.go
}

learnFromARPRequest := vpc.Spec.EnableExternal
learnFromARPRequest := vpc.Spec.EnableExternal || len(vpc.Spec.VpcPeerings) != 0
Comment thread pkg/controller/vpc.go
}

learnFromARPRequest := vpc.Spec.EnableExternal
learnFromARPRequest := vpc.Spec.EnableExternal || len(vpc.Spec.VpcPeerings) != 0
VPC peering requires ARP learning on the logical router. Cross-VPC traffic
arrives via the peer LRP, so the destination router needs to learn pod MACs
from ARP requests. Without it, packets are mis-forwarded (tunneled instead
of local delivery).

Previously, learnFromARPRequest was only set for EnableExternal and U2O
interconnection. This patch also enables it when any VpcPeerings exist.

Signed-off-by: Apinant U-suwantim <Hello@Apinant.dev>
@LoneExile
LoneExile force-pushed the fix/vpc-peering-arp-learn branch from addc971 to dbcf176 Compare June 17, 2026 04:39
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 27737245944

Coverage remained the same at 26.652%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: 1 of 1 lines across 1 file are fully covered (100%).
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 59568
Covered Lines: 15876
Line Coverage: 26.65%
Coverage Strength: 0.31 hits per line

💛 - Coveralls

@dosubot dosubot Bot added the lgtm This PR has been approved by a maintainer label Jun 18, 2026
@oilbeater
oilbeater merged commit 70fe403 into kubeovn:master Jun 18, 2026
77 of 78 checks passed
@oilbeater

Copy link
Copy Markdown
Member

Thanks! @LoneExile

oilbeater pushed a commit that referenced this pull request Jun 18, 2026
#6882)

VPC peering requires ARP learning on the logical router. Cross-VPC traffic
arrives via the peer LRP, so the destination router needs to learn pod MACs
from ARP requests. Without it, packets are mis-forwarded (tunneled instead
of local delivery).

Previously, learnFromARPRequest was only set for EnableExternal and U2O
interconnection. This patch also enables it when any VpcPeerings exist.

Signed-off-by: Apinant U-suwantim <Hello@Apinant.dev>
(cherry picked from commit 70fe403)
oilbeater pushed a commit that referenced this pull request Jun 18, 2026
#6882)

VPC peering requires ARP learning on the logical router. Cross-VPC traffic
arrives via the peer LRP, so the destination router needs to learn pod MACs
from ARP requests. Without it, packets are mis-forwarded (tunneled instead
of local delivery).

Previously, learnFromARPRequest was only set for EnableExternal and U2O
interconnection. This patch also enables it when any VpcPeerings exist.

Signed-off-by: Apinant U-suwantim <Hello@Apinant.dev>
(cherry picked from commit 70fe403)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lgtm This PR has been approved by a maintainer size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants