Skip to content

lib: remove the IPIP/ESP tunnel peer path - #22

Merged
shreyas-blacksmith merged 2 commits into
mainfrom
devin/1790567307-remove-ipip-esp
Sep 29, 2026
Merged

shreyas-blacksmith merged 2 commits into
mainfrom
devin/1790567307-remove-ipip-esp

Conversation

@shreyas-blacksmith

@shreyas-blacksmith shreyas-blacksmith commented Sep 28, 2026 •

Copy link
Copy Markdown

Summary

Mac static-IP hosts now reach vprox through the TLS+yamux relay (#21). Nothing calls /connect-ipip any more, so this drops the whole kernel tunnel peer path: the handler, ipipPeer state under ipipMu, per-peer IPIP links + xfrm ESP SAs/policies, the housekeeping sweep, RestoreIpipFromKernel on startup, the IPIP MSS clamp rules, and docs/ESP_OPERATIONS.md.

flowchart LR
  subgraph before [Before]
    direction TB
    a1[Mac gif+IPsec] -->|/connect-ipip| a2[ipip link + xfrm SA] --> a3[NAT to static IP]
    b1[Linux wg] -->|/connect| b2[WireGuard peer] --> a3
  end
  subgraph after [After]
    direction TB
    c1[Mac egress proxy] -->|TLS+yamux relay :9443| c3[dial bound to static IP]
    d1[Linux wg] -->|/connect| d2[WireGuard peer] --> d3[NAT to static IP]
  end
  before ~~~ after
Loading

What stays: /connect + WireGuard peers, the iptables rules they need, and the relay. ServerManager.Start still leaves WireGuard and iptables in place across restarts; only the IPIP restore step is gone.

Companion: the fa Ansible setup_vprox_server.yaml still installs the proto-4/ESP accept rules from ipip_client_cidrs; those go with the fa proxy-only stack.

-3526 / +15 lines. go build ./... && go vet ./... && go test ./... green.

Link to Devin session: https://app.devin.ai/sessions/3732a5e335164324a71ec27bf19595aa
Open in Devin Desktop: https://app.devin.ai/desktop/session/3732a5e335164324a71ec27bf19595aa?variant=devin
Requested by: @shreyas-blacksmith


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled. (Staging)


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Mac static-IP hosts reach vprox through the TLS+yamux relay, so the
/connect-ipip control-plane endpoint, the per-peer IPIP interfaces and
xfrm ESP state, the housekeeping sweep, the kernel restore on startup and
the IPIP MSS clamping rules have no clients. WireGuard peers and the
relay are unaffected.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@shreyas-blacksmith
shreyas-blacksmith marked this pull request as ready for review September 28, 2026 14:41

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 92cf1b9. Configure here.

Comment thread lib/server_manager.go
Deploys leave the kernel dataplane in place, so a host upgraded from a
release that ran the IPIP/ESP tunnel path still carries its vp<index>-*
tunnels, their /32 host routes, per-tunnel FORWARD filters, MSS clamps
and ESP SAs/policies. A leftover /32 outranks WireGuard's connected
prefix for the same inner IP, so a WireGuard peer later allocated that
address would have its return traffic blackholed into the dead tunnel.
Remove all of it once at startup and fail readiness if that is not
possible.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@shreyas-blacksmith
shreyas-blacksmith merged commit d1e8a7a into main Sep 29, 2026
8 checks passed
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.

2 participants