Skip to content

Detect captive portals and back off in ml_coord (mined from cplewes/microlink) #23

Description

@fudio101

Source

cplewes/microlink commits 8f2ff39b + 5c7303b4.

Problem

On a WiFi network with a captive portal, the control-plane connection attempt gets an HTTP 302 redirect (or the TCP connection closes / recv() returns 0) instead of a real Tailscale coordination response. Without portal detection, ml_coord retries every ~16s indefinitely, wasting power/airtime on a connection that will never succeed until the user completes the portal login.

Fix

Detect the captcaptive-portal signature (HTTP 302, or TCP close/recv=0) in ml_coord.c and back off 5 minutes instead of the normal retry cadence.

Related

Companion commit 201296dd (same fork) adds an empty-MapResponse counter + HEADERS payload preview that escalates backoff after repeated empty responses — mostly diagnostic/defensive, lower priority than the core captive-portal detection; consider folding in only if it's cheap once this issue is scoped.

Target files

components/microlink/src/ml_coord.c.

Tier 1 — high confidence, hardware-verified. See FORK_PRS.md row 4.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions